V8 Project
maglev-ir.h
Go to the documentation of this file.
1 // Copyright 2021 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_MAGLEV_MAGLEV_IR_H_
6 #define V8_MAGLEV_MAGLEV_IR_H_
7 
8 #include <optional>
9 #include <type_traits>
10 
11 #include "src/base/bit-field.h"
12 #include "src/base/bits.h"
13 #include "src/base/bounds.h"
15 #include "src/base/enum-set.h"
16 #include "src/base/logging.h"
17 #include "src/base/macros.h"
18 #include "src/base/small-vector.h"
19 #include "src/base/threaded-list.h"
21 #include "src/codegen/label.h"
23 #include "src/codegen/reglist.h"
25 #include "src/common/globals.h"
26 #include "src/common/operation.h"
31 #include "src/compiler/heap-refs.h"
32 // TODO(dmercadier): move the Turboshaft utils functions to shared code (in
33 // particular, any_of, which is the reason we're including this Turboshaft
34 // header)
42 #include "src/objects/arguments.h"
45 #include "src/objects/smi.h"
47 #include "src/roots/roots.h"
49 #include "src/utils/utils.h"
50 #include "src/zone/zone.h"
51 
52 #ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
53 #define IF_UD(Macro, ...) Macro(__VA_ARGS__)
54 #else
55 #define IF_UD(Macro, ...)
56 #endif // V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
57 
58 namespace v8 {
59 namespace internal {
60 
61 enum Condition : int;
62 
63 namespace maglev {
64 
65 class BasicBlock;
66 class ProcessingState;
67 class MaglevAssembler;
68 class MaglevCodeGenState;
69 class MaglevCompilationUnit;
70 class MaglevGraphLabeller;
71 class MaglevVregAllocationState;
72 class CompactInterpreterFrameState;
73 class MergePointInterpreterFrameState;
74 class ExceptionHandlerInfo;
75 
76 // Nodes are either
77 // 1. side-effecting or value-holding SSA nodes in the body of basic blocks, or
78 // 2. Control nodes that store the control flow at the end of basic blocks, and
79 // form a separate node hierarchy to non-control nodes.
80 //
81 // The macro lists below must match the node class hierarchy.
82 
83 #define GENERIC_OPERATIONS_NODE_LIST(V) \
84  V(GenericAdd) \
85  V(GenericSubtract) \
86  V(GenericMultiply) \
87  V(GenericDivide) \
88  V(GenericModulus) \
89  V(GenericExponentiate) \
90  V(GenericBitwiseAnd) \
91  V(GenericBitwiseOr) \
92  V(GenericBitwiseXor) \
93  V(GenericShiftLeft) \
94  V(GenericShiftRight) \
95  V(GenericShiftRightLogical) \
96  V(GenericBitwiseNot) \
97  V(GenericNegate) \
98  V(GenericIncrement) \
99  V(GenericDecrement) \
100  V(GenericEqual) \
101  V(GenericStrictEqual) \
102  V(GenericLessThan) \
103  V(GenericLessThanOrEqual) \
104  V(GenericGreaterThan) \
105  V(GenericGreaterThanOrEqual)
106 
107 #define INT32_OPERATIONS_NODE_LIST(V) \
108  V(Int32AbsWithOverflow) \
109  V(Int32AddWithOverflow) \
110  V(Int32SubtractWithOverflow) \
111  V(Int32MultiplyWithOverflow) \
112  V(Int32DivideWithOverflow) \
113  V(Int32ModulusWithOverflow) \
114  V(Int32BitwiseAnd) \
115  V(Int32BitwiseOr) \
116  V(Int32BitwiseXor) \
117  V(Int32ShiftLeft) \
118  V(Int32ShiftRight) \
119  V(Int32ShiftRightLogical) \
120  V(Int32BitwiseNot) \
121  V(Int32NegateWithOverflow) \
122  V(Int32IncrementWithOverflow) \
123  V(Int32DecrementWithOverflow) \
124  V(Int32Compare) \
125  V(Int32ToBoolean)
126 
127 #define FLOAT64_OPERATIONS_NODE_LIST(V) \
128  V(Float64Abs) \
129  V(Float64Add) \
130  V(Float64Subtract) \
131  V(Float64Multiply) \
132  V(Float64Divide) \
133  V(Float64Exponentiate) \
134  V(Float64Modulus) \
135  V(Float64Negate) \
136  V(Float64Round) \
137  V(Float64Compare) \
138  V(Float64ToBoolean) \
139  V(Float64Ieee754Unary)
140 
141 #define SMI_OPERATIONS_NODE_LIST(V) \
142  V(CheckedSmiIncrement) \
143  V(CheckedSmiDecrement)
144 
145 #define CONSTANT_VALUE_NODE_LIST(V) \
146  V(Constant) \
147  V(ExternalConstant) \
148  V(Float64Constant) \
149  V(Int32Constant) \
150  V(Uint32Constant) \
151  V(IntPtrConstant) \
152  V(RootConstant) \
153  V(SmiConstant) \
154  V(TaggedIndexConstant) \
155  V(TrustedConstant)
156 
157 #define INLINE_BUILTIN_NODE_LIST(V) \
158  V(BuiltinStringFromCharCode) \
159  V(BuiltinStringPrototypeCharCodeOrCodePointAt) \
160  V(BuiltinSeqOneByteStringCharCodeAt)
161 
162 #define TURBOLEV_VALUE_NODE_LIST(V) \
163  V(CreateFastArrayElements) \
164  V(MapPrototypeGet) \
165  V(MapPrototypeGetInt32Key) \
166  V(SetPrototypeHas)
167 
168 #define TURBOLEV_NON_VALUE_NODE_LIST(V) V(TransitionAndStoreArrayElement)
169 
170 #define VALUE_NODE_LIST(V) \
171  V(Identity) \
172  V(AllocationBlock) \
173  V(ArgumentsElements) \
174  V(ArgumentsLength) \
175  V(RestLength) \
176  V(Call) \
177  V(CallBuiltin) \
178  V(CallCPPBuiltin) \
179  V(CallForwardVarargs) \
180  V(CallRuntime) \
181  V(CallWithArrayLike) \
182  V(CallWithSpread) \
183  V(CallKnownApiFunction) \
184  V(CallKnownJSFunction) \
185  V(CallSelf) \
186  V(Construct) \
187  V(CheckConstructResult) \
188  V(CheckDerivedConstructResult) \
189  V(ConstructWithSpread) \
190  V(ConvertReceiver) \
191  V(ConvertHoleToUndefined) \
192  V(CreateArrayLiteral) \
193  V(CreateShallowArrayLiteral) \
194  V(CreateObjectLiteral) \
195  V(CreateShallowObjectLiteral) \
196  V(CreateFunctionContext) \
197  V(CreateClosure) \
198  V(FastCreateClosure) \
199  V(CreateRegExpLiteral) \
200  V(DeleteProperty) \
201  V(EnsureWritableFastElements) \
202  V(ExtendPropertiesBackingStore) \
203  V(InlinedAllocation) \
204  V(ForInPrepare) \
205  V(ForInNext) \
206  V(GeneratorRestoreRegister) \
207  V(GetIterator) \
208  V(GetSecondReturnedValue) \
209  V(GetTemplateObject) \
210  V(HasInPrototypeChain) \
211  V(InitialValue) \
212  V(LoadTaggedField) \
213  V(LoadTaggedFieldForProperty) \
214  V(LoadTaggedFieldForContextSlotNoCells) \
215  V(LoadTaggedFieldForContextSlot) \
216  V(LoadDoubleField) \
217  V(LoadFloat64) \
218  V(LoadInt32) \
219  V(LoadTaggedFieldByFieldIndex) \
220  V(LoadFixedArrayElement) \
221  V(LoadFixedDoubleArrayElement) \
222  V(LoadHoleyFixedDoubleArrayElement) \
223  V(LoadHoleyFixedDoubleArrayElementCheckedNotHole) \
224  V(LoadSignedIntDataViewElement) \
225  V(LoadDoubleDataViewElement) \
226  V(LoadTypedArrayLength) \
227  V(LoadSignedIntTypedArrayElement) \
228  V(LoadUnsignedIntTypedArrayElement) \
229  V(LoadDoubleTypedArrayElement) \
230  V(LoadSignedIntConstantTypedArrayElement) \
231  V(LoadUnsignedIntConstantTypedArrayElement) \
232  V(LoadDoubleConstantTypedArrayElement) \
233  V(LoadEnumCacheLength) \
234  V(LoadGlobal) \
235  V(LoadNamedGeneric) \
236  V(LoadNamedFromSuperGeneric) \
237  V(MaybeGrowFastElements) \
238  V(MigrateMapIfNeeded) \
239  V(SetNamedGeneric) \
240  V(DefineNamedOwnGeneric) \
241  V(StoreInArrayLiteralGeneric) \
242  V(StoreGlobal) \
243  V(GetKeyedGeneric) \
244  V(SetKeyedGeneric) \
245  V(DefineKeyedOwnGeneric) \
246  V(Phi) \
247  V(RegisterInput) \
248  V(CheckedSmiSizedInt32) \
249  V(CheckedSmiTagInt32) \
250  V(CheckedSmiTagUint32) \
251  V(CheckedSmiTagIntPtr) \
252  V(UnsafeSmiTagInt32) \
253  V(UnsafeSmiTagUint32) \
254  V(UnsafeSmiTagIntPtr) \
255  V(CheckedSmiUntag) \
256  V(UnsafeSmiUntag) \
257  V(CheckedInternalizedString) \
258  V(CheckedObjectToIndex) \
259  V(CheckedTruncateNumberOrOddballToInt32) \
260  V(CheckedInt32ToUint32) \
261  V(CheckedIntPtrToUint32) \
262  V(UnsafeInt32ToUint32) \
263  V(CheckedUint32ToInt32) \
264  V(CheckedIntPtrToInt32) \
265  V(ChangeInt32ToFloat64) \
266  V(ChangeUint32ToFloat64) \
267  V(ChangeIntPtrToFloat64) \
268  V(CheckedTruncateFloat64ToInt32) \
269  V(CheckedTruncateFloat64ToUint32) \
270  V(TruncateNumberOrOddballToInt32) \
271  V(TruncateUint32ToInt32) \
272  V(TruncateFloat64ToInt32) \
273  V(UnsafeTruncateUint32ToInt32) \
274  V(UnsafeTruncateFloat64ToInt32) \
275  V(Int32ToUint8Clamped) \
276  V(Uint32ToUint8Clamped) \
277  V(Float64ToUint8Clamped) \
278  V(CheckedNumberToUint8Clamped) \
279  V(Int32ToNumber) \
280  V(Uint32ToNumber) \
281  V(Int32CountLeadingZeros) \
282  V(SmiCountLeadingZeros) \
283  V(Float64CountLeadingZeros) \
284  V(IntPtrToBoolean) \
285  V(IntPtrToNumber) \
286  V(Float64ToTagged) \
287  V(Float64ToHeapNumberForField) \
288  V(HoleyFloat64ToTagged) \
289  V(CheckedSmiTagFloat64) \
290  V(CheckedNumberToInt32) \
291  V(CheckedNumberOrOddballToFloat64) \
292  V(UncheckedNumberOrOddballToFloat64) \
293  V(CheckedNumberOrOddballToHoleyFloat64) \
294  V(CheckedHoleyFloat64ToFloat64) \
295  V(HoleyFloat64ToMaybeNanFloat64) \
296  IF_UD(V, Float64ToHoleyFloat64) \
297  IF_UD(V, ConvertHoleNanToUndefinedNan) \
298  V(HoleyFloat64IsHole) \
299  V(LogicalNot) \
300  V(SetPendingMessage) \
301  V(StringAt) \
302  V(StringEqual) \
303  V(StringLength) \
304  V(StringConcat) \
305  V(SeqOneByteStringAt) \
306  V(ConsStringMap) \
307  V(UnwrapStringWrapper) \
308  V(ToBoolean) \
309  V(ToBooleanLogicalNot) \
310  V(AllocateElementsArray) \
311  V(TaggedEqual) \
312  V(TaggedNotEqual) \
313  V(TestInstanceOf) \
314  V(TestUndetectable) \
315  V(TestTypeOf) \
316  V(ToName) \
317  V(ToNumberOrNumeric) \
318  V(ToObject) \
319  V(ToString) \
320  V(TransitionElementsKind) \
321  V(NumberToString) \
322  V(UpdateJSArrayLength) \
323  V(VirtualObject) \
324  V(GetContinuationPreservedEmbedderData) \
325  CONSTANT_VALUE_NODE_LIST(V) \
326  INT32_OPERATIONS_NODE_LIST(V) \
327  FLOAT64_OPERATIONS_NODE_LIST(V) \
328  SMI_OPERATIONS_NODE_LIST(V) \
329  GENERIC_OPERATIONS_NODE_LIST(V) \
330  INLINE_BUILTIN_NODE_LIST(V) \
331  TURBOLEV_VALUE_NODE_LIST(V)
332 
333 #define GAP_MOVE_NODE_LIST(V) \
334  V(ConstantGapMove) \
335  V(GapMove)
336 
337 #define NON_VALUE_NODE_LIST(V) \
338  V(AssertInt32) \
339  V(CheckDynamicValue) \
340  V(CheckInt32IsSmi) \
341  V(CheckUint32IsSmi) \
342  V(CheckIntPtrIsSmi) \
343  V(CheckHoleyFloat64IsSmi) \
344  V(CheckHeapObject) \
345  V(CheckInt32Condition) \
346  V(CheckCacheIndicesNotCleared) \
347  V(CheckJSDataViewBounds) \
348  V(CheckTypedArrayBounds) \
349  V(CheckTypedArrayNotDetached) \
350  V(CheckMaps) \
351  V(CheckMapsWithMigrationAndDeopt) \
352  V(CheckMapsWithMigration) \
353  V(CheckMapsWithAlreadyLoadedMap) \
354  V(CheckDetectableCallable) \
355  V(CheckJSReceiverOrNullOrUndefined) \
356  V(CheckNotHole) \
357  V(CheckHoleyFloat64NotHole) \
358  V(CheckNumber) \
359  V(CheckSmi) \
360  V(CheckString) \
361  V(CheckSeqOneByteString) \
362  V(CheckStringOrStringWrapper) \
363  V(CheckStringOrOddball) \
364  V(CheckSymbol) \
365  V(CheckValue) \
366  V(CheckValueEqualsInt32) \
367  V(CheckFloat64SameValue) \
368  V(CheckValueEqualsString) \
369  V(CheckInstanceType) \
370  V(Dead) \
371  V(DebugBreak) \
372  V(FunctionEntryStackCheck) \
373  V(GeneratorStore) \
374  V(TryOnStackReplacement) \
375  V(StoreMap) \
376  V(StoreDoubleField) \
377  V(StoreFixedArrayElementWithWriteBarrier) \
378  V(StoreFixedArrayElementNoWriteBarrier) \
379  V(StoreFixedDoubleArrayElement) \
380  V(StoreInt32) \
381  V(StoreFloat64) \
382  V(StoreIntTypedArrayElement) \
383  V(StoreDoubleTypedArrayElement) \
384  V(StoreIntConstantTypedArrayElement) \
385  V(StoreDoubleConstantTypedArrayElement) \
386  V(StoreSignedIntDataViewElement) \
387  V(StoreDoubleDataViewElement) \
388  V(StoreTaggedFieldNoWriteBarrier) \
389  V(StoreTaggedFieldWithWriteBarrier) \
390  V(StoreContextSlotWithWriteBarrier) \
391  V(StoreTrustedPointerFieldWithWriteBarrier) \
392  V(HandleNoHeapWritesInterrupt) \
393  V(ReduceInterruptBudgetForLoop) \
394  V(ReduceInterruptBudgetForReturn) \
395  V(ThrowReferenceErrorIfHole) \
396  V(ThrowSuperNotCalledIfHole) \
397  V(ThrowSuperAlreadyCalledIfNotHole) \
398  V(ThrowIfNotCallable) \
399  V(ThrowIfNotSuperConstructor) \
400  V(TransitionElementsKindOrCheckMap) \
401  V(SetContinuationPreservedEmbedderData) \
402  GAP_MOVE_NODE_LIST(V) \
403  TURBOLEV_NON_VALUE_NODE_LIST(V)
404 
405 #define NODE_LIST(V) \
406  NON_VALUE_NODE_LIST(V) \
407  VALUE_NODE_LIST(V)
408 
409 #define BRANCH_CONTROL_NODE_LIST(V) \
410  V(BranchIfSmi) \
411  V(BranchIfRootConstant) \
412  V(BranchIfToBooleanTrue) \
413  V(BranchIfInt32ToBooleanTrue) \
414  V(BranchIfIntPtrToBooleanTrue) \
415  V(BranchIfFloat64ToBooleanTrue) \
416  V(BranchIfFloat64IsHole) \
417  V(BranchIfReferenceEqual) \
418  V(BranchIfInt32Compare) \
419  V(BranchIfUint32Compare) \
420  V(BranchIfFloat64Compare) \
421  V(BranchIfUndefinedOrNull) \
422  V(BranchIfUndetectable) \
423  V(BranchIfJSReceiver) \
424  V(BranchIfTypeOf)
425 
426 #define CONDITIONAL_CONTROL_NODE_LIST(V) \
427  V(Switch) \
428  BRANCH_CONTROL_NODE_LIST(V)
429 
430 #define UNCONDITIONAL_CONTROL_NODE_LIST(V) \
431  V(Jump) \
432  V(CheckpointedJump) \
433  V(JumpLoop)
434 
435 #define TERMINAL_CONTROL_NODE_LIST(V) \
436  V(Abort) \
437  V(Return) \
438  V(Deopt)
439 
440 #define CONTROL_NODE_LIST(V) \
441  TERMINAL_CONTROL_NODE_LIST(V) \
442  CONDITIONAL_CONTROL_NODE_LIST(V) \
443  UNCONDITIONAL_CONTROL_NODE_LIST(V)
444 
445 #define NODE_BASE_LIST(V) \
446  NODE_LIST(V) \
447  CONTROL_NODE_LIST(V)
448 
449 // Define the opcode enum.
450 #define DEF_OPCODES(type) k##type,
452 #undef DEF_OPCODES
453 #define PLUS_ONE(type) +1
454 static constexpr int kOpcodeCount = NODE_BASE_LIST(PLUS_ONE);
455 static constexpr Opcode kFirstOpcode = static_cast<Opcode>(0);
456 static constexpr Opcode kLastOpcode = static_cast<Opcode>(kOpcodeCount - 1);
457 #undef PLUS_ONE
458 
459 const char* OpcodeToString(Opcode opcode);
460 inline std::ostream& operator<<(std::ostream& os, Opcode opcode) {
461  return os << OpcodeToString(opcode);
462 }
463 
464 #define V(Name) Opcode::k##Name,
465 static constexpr Opcode kFirstValueNodeOpcode =
466  std::min({VALUE_NODE_LIST(V) kLastOpcode});
467 static constexpr Opcode kLastValueNodeOpcode =
468  std::max({VALUE_NODE_LIST(V) kFirstOpcode});
469 static constexpr Opcode kFirstConstantNodeOpcode =
470  std::min({CONSTANT_VALUE_NODE_LIST(V) kLastOpcode});
471 static constexpr Opcode kLastConstantNodeOpcode =
472  std::max({CONSTANT_VALUE_NODE_LIST(V) kFirstOpcode});
473 static constexpr Opcode kFirstGapMoveNodeOpcode =
474  std::min({GAP_MOVE_NODE_LIST(V) kLastOpcode});
475 static constexpr Opcode kLastGapMoveNodeOpcode =
476  std::max({GAP_MOVE_NODE_LIST(V) kFirstOpcode});
477 
478 static constexpr Opcode kFirstNodeOpcode = std::min({NODE_LIST(V) kLastOpcode});
479 static constexpr Opcode kLastNodeOpcode = std::max({NODE_LIST(V) kFirstOpcode});
480 
481 static constexpr Opcode kFirstBranchControlNodeOpcode =
482  std::min({BRANCH_CONTROL_NODE_LIST(V) kLastOpcode});
483 static constexpr Opcode kLastBranchControlNodeOpcode =
484  std::max({BRANCH_CONTROL_NODE_LIST(V) kFirstOpcode});
485 
486 static constexpr Opcode kFirstConditionalControlNodeOpcode =
487  std::min({CONDITIONAL_CONTROL_NODE_LIST(V) kLastOpcode});
488 static constexpr Opcode kLastConditionalControlNodeOpcode =
489  std::max({CONDITIONAL_CONTROL_NODE_LIST(V) kFirstOpcode});
490 
491 static constexpr Opcode kLastUnconditionalControlNodeOpcode =
492  std::max({UNCONDITIONAL_CONTROL_NODE_LIST(V) kFirstOpcode});
493 static constexpr Opcode kFirstUnconditionalControlNodeOpcode =
494  std::min({UNCONDITIONAL_CONTROL_NODE_LIST(V) kLastOpcode});
495 
496 static constexpr Opcode kLastTerminalControlNodeOpcode =
497  std::max({TERMINAL_CONTROL_NODE_LIST(V) kFirstOpcode});
498 static constexpr Opcode kFirstTerminalControlNodeOpcode =
499  std::min({TERMINAL_CONTROL_NODE_LIST(V) kLastOpcode});
500 
501 static constexpr Opcode kFirstControlNodeOpcode =
502  std::min({CONTROL_NODE_LIST(V) kLastOpcode});
503 static constexpr Opcode kLastControlNodeOpcode =
504  std::max({CONTROL_NODE_LIST(V) kFirstOpcode});
505 #undef V
506 
507 constexpr bool IsValueNode(Opcode opcode) {
508  return kFirstValueNodeOpcode <= opcode && opcode <= kLastValueNodeOpcode;
509 }
510 constexpr bool IsConstantNode(Opcode opcode) {
511  return kFirstConstantNodeOpcode <= opcode &&
512  opcode <= kLastConstantNodeOpcode;
513 }
514 constexpr bool IsCommutativeNode(Opcode opcode) {
515  switch (opcode) {
516  case Opcode::kFloat64Add:
517  case Opcode::kFloat64Multiply:
518  case Opcode::kGenericStrictEqual:
519  case Opcode::kInt32AddWithOverflow:
520  case Opcode::kInt32BitwiseAnd:
521  case Opcode::kInt32BitwiseOr:
522  case Opcode::kInt32BitwiseXor:
523  case Opcode::kInt32MultiplyWithOverflow:
524  case Opcode::kStringEqual:
525  case Opcode::kTaggedEqual:
526  case Opcode::kTaggedNotEqual:
527  return true;
528  default:
529  return false;
530  }
531 }
532 constexpr bool IsZeroCostNode(Opcode opcode) {
533  switch (opcode) {
534  case Opcode::kTruncateUint32ToInt32:
535  case Opcode::kUnsafeTruncateUint32ToInt32:
536  case Opcode::kIdentity:
537  return true;
538  default:
539  return false;
540  }
541 }
542 constexpr bool IsGapMoveNode(Opcode opcode) {
543  return kFirstGapMoveNodeOpcode <= opcode && opcode <= kLastGapMoveNodeOpcode;
544 }
545 constexpr bool IsControlNode(Opcode opcode) {
546  return kFirstControlNodeOpcode <= opcode && opcode <= kLastControlNodeOpcode;
547 }
548 constexpr bool IsBranchControlNode(Opcode opcode) {
549  return kFirstBranchControlNodeOpcode <= opcode &&
550  opcode <= kLastBranchControlNodeOpcode;
551 }
552 constexpr bool IsConditionalControlNode(Opcode opcode) {
553  return kFirstConditionalControlNodeOpcode <= opcode &&
554  opcode <= kLastConditionalControlNodeOpcode;
555 }
556 constexpr bool IsUnconditionalControlNode(Opcode opcode) {
557  return kFirstUnconditionalControlNodeOpcode <= opcode &&
558  opcode <= kLastUnconditionalControlNodeOpcode;
559 }
560 constexpr bool IsTerminalControlNode(Opcode opcode) {
561  return kFirstTerminalControlNodeOpcode <= opcode &&
562  opcode <= kLastTerminalControlNodeOpcode;
563 }
564 // Simple field stores are stores which do nothing but change a field value
565 // (i.e. no map transitions or calls into user code).
566 constexpr bool IsSimpleFieldStore(Opcode opcode) {
567  return opcode == Opcode::kStoreTaggedFieldWithWriteBarrier ||
568  opcode == Opcode::kStoreTaggedFieldNoWriteBarrier ||
569  opcode == Opcode::kStoreDoubleField ||
570  opcode == Opcode::kStoreFloat64 || opcode == Opcode::kStoreInt32 ||
571  opcode == Opcode::kUpdateJSArrayLength ||
572  opcode == Opcode::kStoreFixedArrayElementWithWriteBarrier ||
573  opcode == Opcode::kStoreFixedArrayElementNoWriteBarrier ||
574  opcode == Opcode::kStoreFixedDoubleArrayElement ||
575  opcode == Opcode::kStoreTrustedPointerFieldWithWriteBarrier;
576 }
577 constexpr bool IsElementsArrayWrite(Opcode opcode) {
578  return opcode == Opcode::kMaybeGrowFastElements ||
579  opcode == Opcode::kEnsureWritableFastElements;
580 }
581 constexpr bool IsTypedArrayStore(Opcode opcode) {
582  return opcode == Opcode::kStoreIntTypedArrayElement ||
583  opcode == Opcode::kStoreDoubleTypedArrayElement;
584 }
585 
586 constexpr bool CanBeStoreToNonEscapedObject(Opcode opcode) {
587  switch (opcode) {
588  case Opcode::kStoreMap:
589  case Opcode::kStoreInt32:
590  case Opcode::kStoreTrustedPointerFieldWithWriteBarrier:
591  case Opcode::kStoreTaggedFieldWithWriteBarrier:
592  case Opcode::kStoreTaggedFieldNoWriteBarrier:
593  case Opcode::kStoreContextSlotWithWriteBarrier:
594  case Opcode::kStoreFloat64:
595  return true;
596  default:
597  return false;
598  }
599 }
600 
601 // Forward-declare NodeBase sub-hierarchies.
602 class Node;
603 class ControlNode;
604 class ConditionalControlNode;
605 class BranchControlNode;
606 class UnconditionalControlNode;
607 class TerminalControlNode;
608 class ValueNode;
609 
610 enum class ValueRepresentation : uint8_t {
611  kTagged,
612  kInt32,
613  kUint32,
614  kFloat64,
616  kIntPtr
617 };
618 
619 inline constexpr bool IsDoubleRepresentation(ValueRepresentation repr) {
620  return repr == ValueRepresentation::kFloat64 ||
622 }
623 
625 #if defined(V8_TARGET_ARCH_RISCV64)
626  // on RISC-V int32 are always sign-extended
627  return false;
628 #else
629  return (repr == ValueRepresentation::kUint32 ||
631 #endif
632 }
633 
634 // TODO(olivf): Rename Unknown to Any.
635 
636 /* Every object should belong to exactly one of these.*/
637 #define LEAF_NODE_TYPE_LIST(V) \
638  V(Smi, (1 << 0)) \
639  V(HeapNumber, (1 << 1)) \
640  V(Null, (1 << 2)) \
641  V(Undefined, (1 << 3)) \
642  V(Boolean, (1 << 4)) \
643  V(Symbol, (1 << 5)) \
644  /* String Venn diagram: */ \
645  /* ┌String───────────────────────────────────┐ */ \
646  /* │ OtherString │ */ \
647  /* │┌InternalizedString───┐ │ */ \
648  /* ││ │ │ */ \
649  /* ││OtherInternalized │ │ */ \
650  /* ││String │ │ */ \
651  /* │├─────────────────────┼─SeqOneByteString┐│ */ \
652  /* ││ │ ││ */ \
653  /* ││OtherSeqInternalized │ OtherSeqOneByte ││ */ \
654  /* ││OneByteString │ String ││ */ \
655  /* │├──────────────────┐ │ ││ */ \
656  /* ││ROSeqInternalized │ │ ││ */ \
657  /* ││OneByteString │ │ ││ */ \
658  /* │└──────────────────┴──┴─────────────────┘│ */ \
659  /* └─────────────────────────────────────────┘ */ \
660  V(ROSeqInternalizedOneByteString, (1 << 6)) \
661  V(OtherSeqInternalizedOneByteString, (1 << 7)) \
662  V(OtherInternalizedString, (1 << 8)) \
663  V(OtherSeqOneByteString, (1 << 9)) \
664  V(OtherString, (1 << 10)) \
665  \
666  V(Context, (1 << 11)) \
667  V(StringWrapper, (1 << 12)) \
668  V(JSArray, (1 << 13)) \
669  V(JSFunction, (1 << 14)) \
670  V(OtherCallable, (1 << 15)) \
671  V(OtherHeapObject, (1 << 16)) \
672  V(OtherJSReceiver, (1 << 17))
673 
674 #define COUNT(...) +1
675 static constexpr int kNumberOfLeafNodeTypes = 0 LEAF_NODE_TYPE_LIST(COUNT);
676 #undef COUNT
677 
678 #define COMBINED_NODE_TYPE_LIST(V) \
679  /* A value which has all the above bits set */ \
680  V(Unknown, ((1 << kNumberOfLeafNodeTypes) - 1)) \
681  V(Callable, kJSFunction | kOtherCallable) \
682  V(NullOrUndefined, kNull | kUndefined) \
683  V(Oddball, kNullOrUndefined | kBoolean) \
684  V(Number, kSmi | kHeapNumber) \
685  V(NumberOrBoolean, kNumber | kBoolean) \
686  V(NumberOrOddball, kNumber | kOddball) \
687  V(InternalizedString, kROSeqInternalizedOneByteString | \
688  kOtherSeqInternalizedOneByteString | \
689  kOtherInternalizedString) \
690  V(SeqOneByteString, kROSeqInternalizedOneByteString | \
691  kOtherSeqInternalizedOneByteString | \
692  kOtherSeqOneByteString) \
693  V(String, kInternalizedString | kSeqOneByteString | kOtherString) \
694  V(StringOrStringWrapper, kString | kStringWrapper) \
695  V(StringOrOddball, kString | kOddball) \
696  V(Name, kString | kSymbol) \
697  V(JSReceiver, kJSArray | kCallable | kStringWrapper | kOtherJSReceiver) \
698  V(JSReceiverOrNullOrUndefined, kJSReceiver | kNullOrUndefined) \
699  V(AnyHeapObject, kUnknown - kSmi)
700 
701 #define NODE_TYPE_LIST(V) \
702  LEAF_NODE_TYPE_LIST(V) \
703  COMBINED_NODE_TYPE_LIST(V)
704 
705 enum class NodeType : uint32_t {
706 #define DEFINE_NODE_TYPE(Name, Value) k##Name = Value,
708 #undef DEFINE_NODE_TYPE
709 };
710 using NodeTypeInt = std::underlying_type_t<NodeType>;
711 
712 // Some leaf node types only exist to complement other leaf node types in a
713 // combined type. We never expect to see these as standalone types.
714 inline constexpr bool NodeTypeIsNeverStandalone(NodeType type) {
715  switch (type) {
716  // "Other" string types should be considered internal and never appear as
717  // standalone leaf types.
718  case NodeType::kOtherCallable:
719  case NodeType::kOtherInternalizedString:
720  case NodeType::kOtherSeqInternalizedOneByteString:
721  case NodeType::kOtherSeqOneByteString:
722  case NodeType::kOtherString:
723  return true;
724  default:
725  return false;
726  }
727 }
728 
729 inline constexpr NodeType EmptyNodeType() { return static_cast<NodeType>(0); }
730 
731 inline constexpr NodeType IntersectType(NodeType left, NodeType right) {
734  return static_cast<NodeType>(static_cast<NodeTypeInt>(left) &
735  static_cast<NodeTypeInt>(right));
736 }
737 inline constexpr NodeType UnionType(NodeType left, NodeType right) {
740  return static_cast<NodeType>(static_cast<NodeTypeInt>(left) |
741  static_cast<NodeTypeInt>(right));
742 }
743 inline constexpr bool NodeTypeIs(NodeType type, NodeType to_check) {
745  DCHECK(!NodeTypeIsNeverStandalone(to_check));
746  NodeTypeInt right = static_cast<NodeTypeInt>(to_check);
747  return (static_cast<NodeTypeInt>(type) & (~right)) == 0;
748 }
749 inline constexpr bool NodeTypeCanBe(NodeType type, NodeType to_check) {
751  DCHECK(!NodeTypeIsNeverStandalone(to_check));
752  NodeTypeInt right = static_cast<NodeTypeInt>(to_check);
753  return (static_cast<NodeTypeInt>(type) & (right)) != 0;
754 }
755 
756 inline constexpr bool NodeTypeIsUnstable(NodeType type) {
758  // Any type that can be a string might be unstable, if the string part of the
759  // type is unstable.
760  if (NodeTypeCanBe(type, NodeType::kString)) {
761  // Extract out the string part of the node type.
762  NodeType string_type = IntersectType(type, NodeType::kString);
763  // RO-space strings are ok, since they can't change.
764  if (string_type == NodeType::kROSeqInternalizedOneByteString) return false;
765  // The generic internalized string type is ok, since it doesn't consider
766  // seqness and internalized strings stay internalized.
767  if (string_type == NodeType::kInternalizedString) return false;
768  // The generic string type is ok, since it defines all strings.
769  if (string_type == NodeType::kString) return false;
770  // Otherwise, a string can get in-place externalized, or in-place converted
771  // to thin if not already internalized, both of which lose seq-ness.
772  // TODO(leszeks): We could probably consider byteness of internalized
773  // strings to be stable, since we can't change byteness with in-place
774  // externalization.
775  return true;
776  }
777  // All other node types are stable.
778  return false;
779 }
780 // Seq strings are unstable because they could be in-place converted to thin
781 // strings.
782 static_assert(NodeTypeIsUnstable(NodeType::kSeqOneByteString));
783 // Internalized strings are stable because they have to stay internalized.
784 static_assert(!NodeTypeIsUnstable(NodeType::kInternalizedString));
785 // RO internalized strings are stable because they are read-only.
786 static_assert(!NodeTypeIsUnstable(NodeType::kROSeqInternalizedOneByteString));
787 // The generic string type is stable because we've already erased any
788 // information about it.
789 static_assert(!NodeTypeIsUnstable(NodeType::kString));
790 // A type which contains an unstable string should also be unstable.
791 static_assert(NodeTypeIsUnstable(UnionType(NodeType::kNumber,
792  NodeType::kSeqOneByteString)));
793 // A type which contains a stable string should also be stable.
794 static_assert(!NodeTypeIsUnstable(UnionType(NodeType::kNumber,
795  NodeType::kInternalizedString)));
796 
799  if (!NodeTypeIsUnstable(type)) return type;
800  // Strings can be in-place internalized, turned into thin strings, and
801  // in-place externalized, and byteness can change from one->two byte (because
802  // of internalized external strings with two-byte encoding of one-byte data)
803  // or two->one byte (because of internalizing a two-byte slice with one-byte
804  // data). The only invariant that we can preserve is that internalized strings
805  // stay internalized.
806  DCHECK(NodeTypeCanBe(type, NodeType::kString));
807  // Extract out the string part of the node type.
808  NodeType string_type = IntersectType(type, NodeType::kString);
809  if (NodeTypeIs(string_type, NodeType::kInternalizedString)) {
810  // Strings that can't be anything but internalized become generic
811  // internalized.
812  type = UnionType(type, NodeType::kInternalizedString);
813  } else {
814  // All other strings become fully generic.
815  type = UnionType(type, NodeType::kString);
816  }
818  return type;
819 }
820 // Seq strings become normal strings with unspecified byteness when made stable,
821 // because they could have been internalized into a two-byte external string.
822 static_assert(MakeTypeStable(NodeType::kSeqOneByteString) == NodeType::kString);
823 // Generic internalized strings stay as they are.
824 static_assert(MakeTypeStable(NodeType::kInternalizedString) ==
825  NodeType::kInternalizedString);
826 // Read-only seq internalized strings become generic.
827 static_assert(MakeTypeStable(NodeType::kROSeqInternalizedOneByteString) ==
828  NodeType::kROSeqInternalizedOneByteString);
829 // Stabilizing a type which is partially an unstable string should generalize
830 // the string part of the type
831 static_assert(MakeTypeStable(UnionType(NodeType::kNumber,
832  NodeType::kSeqOneByteString)) ==
833  UnionType(NodeType::kNumber, NodeType::kString));
834 
835 // Assert that the Unknown type is constructed correctly.
836 #define ADD_STATIC_ASSERT(Name, Value) \
837  static_assert(NodeTypeIsNeverStandalone(NodeType::k##Name) || \
838  NodeTypeIs(NodeType::k##Name, NodeType::kUnknown));
840 #undef ADD_STATIC_ASSERT
841 
844  if (map.IsHeapNumberMap()) return NodeType::kHeapNumber;
845  if (map.IsStringMap()) {
846  if (map.IsInternalizedStringMap()) {
847  return NodeType::kInternalizedString;
848  }
849  if (map.IsSeqStringMap() && map.IsOneByteStringMap()) {
850  return NodeType::kSeqOneByteString;
851  }
852  return NodeType::kString;
853  }
854  if (map.IsStringWrapperMap()) return NodeType::kStringWrapper;
855  if (map.IsSymbolMap()) return NodeType::kSymbol;
856  if (map.IsBooleanMap(broker)) return NodeType::kBoolean;
857  if (map.IsOddballMap()) {
858  // Oddball but not a Boolean.
859  return NodeType::kNullOrUndefined;
860  }
861  if (map.IsContextMap()) return NodeType::kContext;
862  if (map.IsJSArrayMap()) return NodeType::kJSArray;
863  if (map.IsJSFunctionMap()) return NodeType::kJSFunction;
864  if (map.is_callable()) {
865  return NodeType::kCallable;
866  }
867  if (map.IsJSReceiverMap()) {
868  // JSReceiver but not any of the above.
869  return NodeType::kOtherJSReceiver;
870  }
871  return NodeType::kOtherHeapObject;
872 }
873 
874 inline constexpr bool IsEmptyNodeType(NodeType type) {
875  // No bits are set.
876  return static_cast<int>(type) == 0;
877 }
878 
880  compiler::ObjectRef ref) {
881  if (ref.IsSmi()) return NodeType::kSmi;
882  NodeType type = StaticTypeForMap(ref.AsHeapObject().map(broker), broker);
884  if (type == NodeType::kInternalizedString && ref.is_read_only()) {
885  if (ref.AsString().IsSeqString() &&
886  ref.AsString().IsOneByteRepresentation()) {
887  type = NodeType::kROSeqInternalizedOneByteString;
888  }
889  }
890  return type;
891 }
892 
895  switch (type) {
896  case NodeType::kSmi:
897  return false;
898  case NodeType::kHeapNumber:
899  return map.IsHeapNumberMap();
900  case NodeType::kNull:
901  return map.IsNullMap(broker);
902  case NodeType::kUndefined:
903  return map.IsUndefinedMap(broker);
904  case NodeType::kBoolean:
905  return map.IsBooleanMap(broker);
906  case NodeType::kSymbol:
907  return map.IsSymbolMap();
908  case NodeType::kOtherString:
909  // This doesn't exclude other string leaf types, which means one should
910  // never test for this node type alone.
911  return map.IsStringMap();
912  case NodeType::kOtherSeqOneByteString:
913  return map.IsSeqStringMap() && map.IsOneByteStringMap();
914  // We can't prove with a map alone that an object is in RO-space, but
915  // these maps will be potential candidates.
916  case NodeType::kROSeqInternalizedOneByteString:
917  case NodeType::kOtherSeqInternalizedOneByteString:
918  return map.IsInternalizedStringMap() && map.IsSeqStringMap() &&
919  map.IsOneByteStringMap();
920  case NodeType::kOtherInternalizedString:
921  return map.IsInternalizedStringMap();
922  case NodeType::kStringWrapper:
923  return map.IsStringWrapperMap();
924  case NodeType::kContext:
925  return map.IsContextMap();
926  case NodeType::kJSArray:
927  return map.IsJSArrayMap();
928  case NodeType::kJSFunction:
929  return map.IsJSFunctionMap();
930  case NodeType::kCallable:
931  return map.is_callable();
932  case NodeType::kOtherCallable:
933  return map.is_callable() && !map.IsJSFunctionMap();
934  case NodeType::kOtherJSReceiver:
935  return map.IsJSReceiverMap() && !map.IsJSArrayMap() &&
936  !map.is_callable() && !map.IsStringWrapperMap();
937  case NodeType::kOtherHeapObject:
938  return !map.IsHeapNumberMap() && !map.IsOddballMap() &&
939  !map.IsContextMap() && !map.IsSymbolMap() && !map.IsStringMap() &&
940  !map.IsJSReceiverMap();
941  default:
942  UNREACHABLE();
943  }
944 }
945 
949 
950  // Early return for any heap object.
951  if (NodeTypeIs(NodeType::kAnyHeapObject, type)) {
952  // Unknown types will be handled here too.
953  static_assert(NodeTypeIs(NodeType::kAnyHeapObject, NodeType::kUnknown));
954  return true;
955  }
956 
957  // Iterate over each leaf type bit in the type bitmask, and check if the map
958  // matches it.
959  NodeTypeInt type_bits = static_cast<NodeTypeInt>(type);
960  while (type_bits != 0) {
961  NodeTypeInt current_bit =
963  NodeType leaf_type = static_cast<NodeType>(current_bit);
964  if (IsInstanceOfLeafNodeType(map, leaf_type, broker)) return true;
965  type_bits = base::bits::ClearLsb(type_bits);
966  }
967  return false;
968 }
969 
970 inline std::ostream& operator<<(std::ostream& out, const NodeType& type) {
971  if (IsEmptyNodeType(type)) {
972  out << "Empty";
973  return out;
974  }
975  switch (type) {
976 #define CASE(Name, _) \
977  case NodeType::k##Name: \
978  out << #Name; \
979  break;
981 #undef CASE
982  default:
983 #define CASE(Name, _) \
984  if (NodeTypeIs(NodeType::k##Name, type)) { \
985  if constexpr (NodeType::k##Name != NodeType::kUnknown) { \
986  out << #Name "|"; \
987  } \
988  }
990 #undef CASE
991  }
992  return out;
993 }
994 
995 #define DEFINE_NODE_TYPE_CHECK(Type, _) \
996  inline bool NodeTypeIs##Type(NodeType type) { \
997  return NodeTypeIs(type, NodeType::k##Type); \
998  }
1000 #undef DEFINE_NODE_TYPE_CHECK
1001 
1003  return (static_cast<int>(type) &
1004  static_cast<int>(NodeType::kNullOrUndefined)) != 0;
1005 }
1006 
1007 enum class TaggedToFloat64ConversionType : uint8_t {
1008  kOnlyNumber,
1011 };
1012 
1013 constexpr Condition ConditionFor(Operation cond);
1014 constexpr Condition ConditionForNaN();
1015 
1016 bool FromConstantToBool(LocalIsolate* local_isolate, ValueNode* node);
1018 
1019 inline std::ostream& operator<<(std::ostream& os,
1020  const ValueRepresentation& repr) {
1021  switch (repr) {
1023  return os << "Tagged";
1025  return os << "Int32";
1027  return os << "Uint32";
1029  return os << "Float64";
1031  return os << "HoleyFloat64";
1033  return os << "Word64";
1034  }
1035 }
1036 
1037 inline std::ostream& operator<<(
1038  std::ostream& os, const TaggedToFloat64ConversionType& conversion_type) {
1039  switch (conversion_type) {
1041  return os << "Number";
1043  return os << "NumberOrBoolean";
1045  return os << "NumberOrOddball";
1046  }
1047 }
1048 
1050  for (compiler::MapRef map : maps) {
1051  if (!map.IsJSTypedArrayMap()) return false;
1052  }
1053  return true;
1054 }
1055 
1057  for (compiler::MapRef map : maps) {
1058  if (!map.IsJSArrayMap()) return false;
1059  }
1060  return true;
1061 }
1062 
1064  for (compiler::MapRef map : maps) {
1065  if (!map.IsJSObjectMap()) return false;
1066  }
1067  return true;
1068 }
1069 
1071  for (compiler::MapRef map : maps) {
1072  if (!map.IsStringMap()) return false;
1073  }
1074  return true;
1075 }
1076 
1078  for (compiler::MapRef map : maps) {
1079  if (map.instance_type() != HEAP_NUMBER_TYPE) return false;
1080  }
1081  return true;
1082 }
1083 
1085  for (compiler::MapRef map : maps) {
1086  if (map.instance_type() == HEAP_NUMBER_TYPE) return true;
1087  }
1088  return false;
1089 }
1090 
1091 #define DEF_FORWARD_DECLARATION(type, ...) class type;
1093 #undef DEF_FORWARD_DECLARATION
1094 
1095 using NodeIdT = uint32_t;
1096 static constexpr NodeIdT kInvalidNodeId = 0;
1097 static constexpr NodeIdT kFirstValidNodeId = 1;
1098 
1099 // Represents either a direct BasicBlock pointer, or an entry in a list of
1100 // unresolved BasicBlockRefs which will be mutated (in place) at some point into
1101 // direct BasicBlock pointers.
1103  struct BasicBlockRefBuilder;
1104 
1105  public:
1107 #ifdef DEBUG
1108  state_ = kRefList;
1109 #endif
1110  }
1112 #ifdef DEBUG
1113  state_ = kBlockPointer;
1114 #endif
1115  }
1116 
1117  // Refs can't be copied or moved, since they are referenced by `this` pointer
1118  // in the ref list.
1119  BasicBlockRef(const BasicBlockRef&) = delete;
1123 
1124  // Construct a new ref-list mode BasicBlockRef and add it to the given ref
1125  // list.
1126  explicit BasicBlockRef(BasicBlockRef* ref_list_head) : BasicBlockRef() {
1127  BasicBlockRef* old_next_ptr = MoveToRefList(ref_list_head);
1128  USE(old_next_ptr);
1129  DCHECK_NULL(old_next_ptr);
1130  }
1131 
1132  // Change this ref to a direct basic block pointer, returning the old "next"
1133  // pointer of the current ref.
1135  DCHECK_EQ(state_, kRefList);
1136 
1137  BasicBlockRef* old_next_ptr = next_ref_;
1138  block_ptr_ = block;
1139 #ifdef DEBUG
1140  state_ = kBlockPointer;
1141 #endif
1142  return old_next_ptr;
1143  }
1144 
1145  // Reset this ref list to null, returning the old ref list (i.e. the old
1146  // "next" pointer).
1148  DCHECK_EQ(state_, kRefList);
1149 
1150  BasicBlockRef* old_next_ptr = next_ref_;
1151  next_ref_ = nullptr;
1152  return old_next_ptr;
1153  }
1154 
1155  // Move this ref to the given ref list, returning the old "next" pointer of
1156  // the current ref.
1158  DCHECK_EQ(state_, kRefList);
1159  DCHECK_EQ(ref_list_head->state_, kRefList);
1160 
1161  BasicBlockRef* old_next_ptr = next_ref_;
1162  next_ref_ = ref_list_head->next_ref_;
1163  ref_list_head->next_ref_ = this;
1164  return old_next_ptr;
1165  }
1166 
1168  DCHECK_EQ(state_, kRefList);
1169 
1171  while (next_ref != nullptr) {
1173  }
1175  }
1176 
1178  DCHECK_EQ(state_, kBlockPointer);
1179  return block_ptr_;
1180  }
1181 
1183  DCHECK_EQ(state_, kBlockPointer);
1184  block_ptr_ = block;
1185  }
1186 
1188  DCHECK_EQ(state_, kRefList);
1189  return next_ref_;
1190  }
1191 
1192  bool has_ref() const {
1193  DCHECK_EQ(state_, kRefList);
1194  return next_ref_ != nullptr;
1195  }
1196 
1197  private:
1198  union {
1201  };
1202 #ifdef DEBUG
1203  enum { kBlockPointer, kRefList } state_;
1204 #endif // DEBUG
1205 };
1206 
1208  public:
1209  constexpr bool is_call() const {
1210  // Only returns true for non-deferred calls. Use `is_any_call` to check
1211  // deferred calls as well.
1212  return kIsCallBit::decode(bitfield_);
1213  }
1214  constexpr bool is_any_call() const { return is_call() || is_deferred_call(); }
1215  constexpr bool can_eager_deopt() const {
1216  return kAttachedDeoptInfoBits::decode(bitfield_) ==
1217  AttachedDeoptInfo::kEager;
1218  }
1219  constexpr bool can_lazy_deopt() const {
1220  return kAttachedDeoptInfoBits::decode(bitfield_) ==
1221  AttachedDeoptInfo::kLazy;
1222  }
1223  constexpr bool is_deopt_checkpoint() const {
1224  return kAttachedDeoptInfoBits::decode(bitfield_) ==
1225  AttachedDeoptInfo::kCheckpoint;
1226  }
1227  constexpr bool can_deopt() const {
1228  return can_eager_deopt() || can_lazy_deopt();
1229  }
1230  constexpr bool can_throw() const {
1231  return kCanThrowBit::decode(bitfield_) && can_lazy_deopt();
1232  }
1233  // TODO(olivf) We should negate all of these properties which would give them
1234  // a less error-prone default state.
1235  constexpr bool can_read() const { return kCanReadBit::decode(bitfield_); }
1236  constexpr bool can_write() const { return kCanWriteBit::decode(bitfield_); }
1237  constexpr bool can_allocate() const {
1238  return kCanAllocateBit::decode(bitfield_);
1239  }
1240  // Only for ValueNodes, indicates that the instruction might return something
1241  // new every time it is executed. For example it creates an object that is
1242  // unique with regards to strict equality comparison or it reads a value that
1243  // can change in absence of an explicit write instruction.
1244  constexpr bool not_idempotent() const {
1245  return kNotIdempotentBit::decode(bitfield_);
1246  }
1248  return kValueRepresentationBits::decode(bitfield_);
1249  }
1250  constexpr bool is_tagged() const {
1252  }
1253  constexpr bool is_conversion() const {
1254  return kIsConversionBit::decode(bitfield_);
1255  }
1256  constexpr bool needs_register_snapshot() const {
1257  return kNeedsRegisterSnapshotBit::decode(bitfield_);
1258  }
1259  constexpr bool is_pure() const {
1260  return (bitfield_ & kPureMask) == kPureValue;
1261  }
1262  constexpr bool is_required_when_unused() const {
1263  if (is_conversion()) {
1264  // Calls in conversions are not counted as a side-effect as far as
1265  // is_required_when_unused is concerned, since they should always be to
1266  // the Allocate builtin.
1267  return can_write() || can_throw() || can_deopt();
1268  } else {
1269  return can_write() || can_throw() || can_deopt() || is_any_call();
1270  }
1271  }
1272  constexpr bool can_participate_in_cse() const {
1273  return !can_write() && !not_idempotent();
1274  }
1275 
1276  constexpr OpProperties operator|(const OpProperties& that) {
1277  return OpProperties(bitfield_ | that.bitfield_);
1278  }
1279 
1280  static constexpr OpProperties Pure() { return OpProperties(kPureValue); }
1281  static constexpr OpProperties Call() {
1282  return OpProperties(kIsCallBit::encode(true));
1283  }
1284  static constexpr OpProperties EagerDeopt() {
1285  return OpProperties(
1286  kAttachedDeoptInfoBits::encode(AttachedDeoptInfo::kEager));
1287  }
1288  static constexpr OpProperties LazyDeopt() {
1289  return OpProperties(
1290  kAttachedDeoptInfoBits::encode(AttachedDeoptInfo::kLazy));
1291  }
1292  static constexpr OpProperties DeoptCheckpoint() {
1293  return OpProperties(
1294  kAttachedDeoptInfoBits::encode(AttachedDeoptInfo::kCheckpoint));
1295  }
1296  static constexpr OpProperties CanThrow() {
1297  return OpProperties(kCanThrowBit::encode(true)) | LazyDeopt() |
1298  CanAllocate();
1299  }
1300  static constexpr OpProperties CanRead() {
1301  return OpProperties(kCanReadBit::encode(true));
1302  }
1303  static constexpr OpProperties CanWrite() {
1304  return OpProperties(kCanWriteBit::encode(true));
1305  }
1306  static constexpr OpProperties CanAllocate() {
1307  return OpProperties(kCanAllocateBit::encode(true));
1308  }
1309  static constexpr OpProperties NotIdempotent() {
1311  }
1312  static constexpr OpProperties TaggedValue() {
1313  return OpProperties(
1315  }
1316  static constexpr OpProperties ExternalReference() {
1317  return OpProperties(
1319  }
1320  static constexpr OpProperties Int32() {
1321  return OpProperties(
1323  }
1324  static constexpr OpProperties Uint32() {
1325  return OpProperties(
1327  }
1328  static constexpr OpProperties Float64() {
1329  return OpProperties(
1331  }
1332  static constexpr OpProperties HoleyFloat64() {
1333  return OpProperties(
1335  }
1336  static constexpr OpProperties IntPtr() {
1337  return OpProperties(
1339  }
1340  static constexpr OpProperties TrustedPointer() {
1341  return OpProperties(
1343  }
1345  ValueRepresentation repr) {
1347  }
1348  static constexpr OpProperties ConversionNode() {
1349  return OpProperties(kIsConversionBit::encode(true));
1350  }
1351  static constexpr OpProperties CanCallUserCode() {
1352  return AnySideEffects() | LazyDeopt() | CanThrow();
1353  }
1354  // Without auditing the call target, we must assume it can cause a lazy deopt
1355  // and throw. Use this when codegen calls runtime or a builtin, unless
1356  // certain that the target either doesn't throw or cannot deopt.
1357  // TODO(jgruber): Go through all nodes marked with this property and decide
1358  // whether to keep it (or remove either the lazy-deopt or throw flag).
1360  return Call() | CanCallUserCode() | NotIdempotent();
1361  }
1362  static constexpr OpProperties JSCall() { return Call() | CanCallUserCode(); }
1363  static constexpr OpProperties AnySideEffects() {
1364  return CanRead() | CanWrite() | CanAllocate();
1365  }
1366  static constexpr OpProperties DeferredCall() {
1367  // Operations with a deferred call need a snapshot of register state,
1368  // because they need to be able to push registers to save them, and annotate
1369  // the safepoint with information about which registers are tagged.
1370  return NeedsRegisterSnapshot();
1371  }
1372 
1373  constexpr explicit OpProperties(uint32_t bitfield) : bitfield_(bitfield) {}
1374  operator uint32_t() const { return bitfield_; }
1375 
1377  return OpProperties(kValueRepresentationBits::update(bitfield_, new_repr));
1378  }
1379 
1381  return OpProperties(
1382  kAttachedDeoptInfoBits::update(bitfield_, AttachedDeoptInfo::kNone));
1383  }
1384 
1385  private:
1386  enum class AttachedDeoptInfo { kNone, kEager, kLazy, kCheckpoint };
1387  using kIsCallBit = base::BitField<bool, 0, 1>;
1388  using kAttachedDeoptInfoBits = kIsCallBit::Next<AttachedDeoptInfo, 2>;
1389  using kCanThrowBit = kAttachedDeoptInfoBits::Next<bool, 1>;
1390  using kCanReadBit = kCanThrowBit::Next<bool, 1>;
1391  using kCanWriteBit = kCanReadBit::Next<bool, 1>;
1392  using kCanAllocateBit = kCanWriteBit::Next<bool, 1>;
1393  using kNotIdempotentBit = kCanAllocateBit::Next<bool, 1>;
1394  using kValueRepresentationBits =
1395  kNotIdempotentBit::Next<ValueRepresentation, 3>;
1396  using kIsConversionBit = kValueRepresentationBits::Next<bool, 1>;
1397  using kNeedsRegisterSnapshotBit = kIsConversionBit::Next<bool, 1>;
1398 
1399  static const uint32_t kPureMask =
1401  static const uint32_t kPureValue = kCanReadBit::encode(false) |
1402  kCanWriteBit::encode(false) |
1403  kCanAllocateBit::encode(false);
1404 
1405  // NeedsRegisterSnapshot is only used for DeferredCall, and we rely on this in
1406  // `is_deferred_call` to detect deferred calls. If you need to use
1407  // NeedsRegisterSnapshot for something else that DeferredCalls, then you'll
1408  // have to update `is_any_call`.
1409  static constexpr OpProperties NeedsRegisterSnapshot() {
1411  }
1412 
1413  const uint32_t bitfield_;
1414 
1415  public:
1417 
1418  constexpr bool is_deferred_call() const {
1419  // Currently, there is no kDeferredCall bit, but DeferredCall only sets a
1420  // single bit: kNeedsRegisterSnapShot. If this static assert breaks, it
1421  // means that you added additional properties to DeferredCall, and you
1422  // should update this function accordingly.
1423  static_assert(DeferredCall().bitfield_ ==
1425  return needs_register_snapshot();
1426  }
1427 };
1428 
1429 constexpr inline OpProperties StaticPropertiesForOpcode(Opcode opcode);
1430 
1432  public:
1433  ValueLocation() = default;
1434 
1435  template <typename... Args>
1436  void SetUnallocated(Args&&... args) {
1437  DCHECK(operand_.IsInvalid());
1438  operand_ = compiler::UnallocatedOperand(args...);
1439  }
1440 
1441  template <typename... Args>
1442  void SetAllocated(Args&&... args) {
1443  DCHECK(operand_.IsUnallocated());
1444  operand_ = compiler::AllocatedOperand(args...);
1445  }
1446 
1447  // Only to be used on inputs that inherit allocation.
1449  operand_ = location;
1450  }
1451 
1452  // We use USED_AT_START to indicate that the input will be clobbered.
1453  bool Cloberred() {
1454  DCHECK(operand_.IsUnallocated());
1455  return compiler::UnallocatedOperand::cast(operand_).IsUsedAtStart();
1456  }
1457 
1458  template <typename... Args>
1459  void SetConstant(Args&&... args) {
1460  DCHECK(operand_.IsUnallocated());
1461  operand_ = compiler::ConstantOperand(args...);
1462  }
1463 
1466  return compiler::AllocatedOperand::cast(operand_).GetRegister();
1467  }
1468 
1472  }
1473 
1474  bool IsAnyRegister() const { return operand_.IsAnyRegister(); }
1475  bool IsGeneralRegister() const { return operand_.IsRegister(); }
1476  bool IsDoubleRegister() const { return operand_.IsDoubleRegister(); }
1477 
1478  const compiler::InstructionOperand& operand() const { return operand_; }
1479  const compiler::InstructionOperand& operand() { return operand_; }
1480 
1481  private:
1483 };
1484 
1486  public:
1487  NodeIdT next_use_id() const { return next_use_id_; }
1488  // Used in ValueNode::mark_use
1489  NodeIdT* get_next_use_id_address() { return &next_use_id_; }
1490 
1491  private:
1492  NodeIdT next_use_id_ = kInvalidNodeId;
1493 };
1494 
1495 class Input : public InputLocation {
1496  public:
1497  explicit Input(ValueNode* node) : node_(node) {}
1498  ValueNode* node() const { return node_; }
1499  void set_node(ValueNode* node) { node_ = node; }
1500  void clear();
1501 
1502  private:
1503  ValueNode* node_;
1504 };
1505 
1506 class VirtualObjectList;
1507 class InterpretedDeoptFrame;
1508 class InlinedArgumentsDeoptFrame;
1509 class ConstructInvokeStubDeoptFrame;
1510 class BuiltinContinuationDeoptFrame;
1511 class DeoptFrame {
1512  public:
1513  enum class FrameType {
1518  };
1519 
1526  };
1527 
1533  };
1534 
1540  };
1541 
1546  compiler::OptionalJSFunctionRef maybe_js_target;
1547  };
1548 
1552 
1554  : data_(std::move(data)), parent_(parent) {}
1555 
1557  : data_(data), parent_(parent) {}
1558 
1559  FrameType type() const { return data_.tag(); }
1560  DeoptFrame* parent() { return parent_; }
1561  const DeoptFrame* parent() const { return parent_; }
1562 
1563  inline const InterpretedDeoptFrame& as_interpreted() const;
1564  inline const InlinedArgumentsDeoptFrame& as_inlined_arguments() const;
1565  inline const ConstructInvokeStubDeoptFrame& as_construct_stub() const;
1571  inline bool IsJsFrame() const;
1572 
1573  inline const MaglevCompilationUnit& GetCompilationUnit() const;
1574  inline BytecodeOffset GetBytecodeOffset() const;
1575  inline SourcePosition GetSourcePosition() const;
1578  inline VirtualObjectList GetVirtualObjects() const;
1579 
1580  protected:
1582  : data_(std::move(data)), parent_(parent) {}
1584  : data_(std::move(data)), parent_(parent) {}
1586  : data_(std::move(data)), parent_(parent) {}
1588  : data_(std::move(data)), parent_(parent) {}
1589 
1592 };
1593 
1595  public:
1602  parent) {}
1603 
1604  const MaglevCompilationUnit& unit() const { return data().unit; }
1606  return data().frame_state;
1607  }
1608  ValueNode*& closure() { return data().closure; }
1609  ValueNode* closure() const { return data().closure; }
1612 
1613  int ComputeReturnOffset(interpreter::Register result_location,
1614  int result_size) const;
1615 
1616  private:
1617  InterpretedFrameData& data() { return data_.get<InterpretedFrameData>(); }
1618  const InterpretedFrameData& data() const {
1619  return data_.get<InterpretedFrameData>();
1620  }
1621 };
1622 
1623 // Make sure storing/passing deopt frames by value doesn't truncate them.
1624 static_assert(sizeof(InterpretedDeoptFrame) == sizeof(DeoptFrame));
1625 
1628  return static_cast<const InterpretedDeoptFrame&>(*this);
1629 }
1632  return static_cast<InterpretedDeoptFrame&>(*this);
1633 }
1634 
1636  public:
1639  ValueNode* closure,
1641  DeoptFrame* parent)
1643  arguments},
1644  parent) {}
1645 
1646  const MaglevCompilationUnit& unit() const { return data().unit; }
1648  ValueNode*& closure() { return data().closure; }
1649  ValueNode* closure() const { return data().closure; }
1650  base::Vector<ValueNode*> arguments() const { return data().arguments; }
1651 
1652  private:
1653  InlinedArgumentsFrameData& data() {
1654  return data_.get<InlinedArgumentsFrameData>();
1655  }
1656  const InlinedArgumentsFrameData& data() const {
1657  return data_.get<InlinedArgumentsFrameData>();
1658  }
1659 };
1660 
1661 // Make sure storing/passing deopt frames by value doesn't truncate them.
1662 static_assert(sizeof(InlinedArgumentsDeoptFrame) == sizeof(DeoptFrame));
1663 
1665  const {
1667  return static_cast<const InlinedArgumentsDeoptFrame&>(*this);
1668 }
1671  return static_cast<InlinedArgumentsDeoptFrame&>(*this);
1672 }
1673 
1675  public:
1679  DeoptFrame* parent)
1681  context},
1682  parent) {}
1683 
1684  const MaglevCompilationUnit& unit() const { return data().unit; }
1685  ValueNode*& receiver() { return data().receiver; }
1686  ValueNode* receiver() const { return data().receiver; }
1687  ValueNode*& context() { return data().context; }
1688  ValueNode* context() const { return data().context; }
1690 
1691  private:
1692  ConstructInvokeStubFrameData& data() {
1693  return data_.get<ConstructInvokeStubFrameData>();
1694  }
1695  const ConstructInvokeStubFrameData& data() const {
1696  return data_.get<ConstructInvokeStubFrameData>();
1697  }
1698 };
1699 
1700 // Make sure storing/passing deopt frames by value doesn't truncate them.
1701 static_assert(sizeof(ConstructInvokeStubDeoptFrame) == sizeof(DeoptFrame));
1702 
1704  const {
1706  return static_cast<const ConstructInvokeStubDeoptFrame&>(*this);
1707 }
1708 
1711  return static_cast<ConstructInvokeStubDeoptFrame&>(*this);
1712 }
1713 
1715  public:
1718  ValueNode* context,
1719  compiler::OptionalJSFunctionRef maybe_js_target,
1720  DeoptFrame* parent)
1722  maybe_js_target},
1723  parent) {}
1724 
1725  const Builtin& builtin_id() const { return data().builtin_id; }
1727  ValueNode*& context() { return data().context; }
1728  ValueNode* context() const { return data().context; }
1729  bool is_javascript() const { return data().maybe_js_target.has_value(); }
1731  return data().maybe_js_target.value();
1732  }
1733 
1734  private:
1735  BuiltinContinuationFrameData& data() {
1736  return data_.get<BuiltinContinuationFrameData>();
1737  }
1738  const BuiltinContinuationFrameData& data() const {
1739  return data_.get<BuiltinContinuationFrameData>();
1740  }
1741 };
1742 
1743 // Make sure storing/passing deopt frames by value doesn't truncate them.
1744 static_assert(sizeof(BuiltinContinuationDeoptFrame) == sizeof(DeoptFrame));
1745 
1746 inline const BuiltinContinuationDeoptFrame&
1749  return static_cast<const BuiltinContinuationDeoptFrame&>(*this);
1750 }
1753  return static_cast<BuiltinContinuationDeoptFrame&>(*this);
1754 }
1755 
1756 inline bool DeoptFrame::IsJsFrame() const {
1757  // This must be in sync with TRANSLATION_JS_FRAME_OPCODE_LIST in
1758  // translation-opcode.h or bad things happen.
1759  switch (data_.tag()) {
1761  return true;
1766  return false;
1767  }
1768 }
1769 
1771  switch (type()) {
1773  return as_interpreted().unit();
1775  return as_inlined_arguments().unit();
1777  return as_construct_stub().unit();
1779  return parent()->GetCompilationUnit();
1780  }
1781 }
1782 
1784  switch (type()) {
1786  return as_interpreted().bytecode_position();
1789  return parent()->GetBytecodeOffset();
1791  return BytecodeOffset::None();
1794  as_builtin_continuation().builtin_id());
1795  }
1796 }
1797 
1799  switch (type()) {
1801  return as_interpreted().source_position();
1804  return parent()->GetSourcePosition();
1809  return parent()->GetSourcePosition();
1810  }
1811 }
1812 
1814  const {
1816 }
1817 
1819  return GetCompilationUnit().bytecode();
1820 }
1821 
1822 class DeoptInfo {
1823  protected:
1824  DeoptInfo(Zone* zone, const DeoptFrame top_frame,
1826 
1827  public:
1828  DeoptFrame& top_frame() { return top_frame_; }
1829  const DeoptFrame& top_frame() const { return top_frame_; }
1831  return feedback_to_update_;
1832  }
1833 
1834  bool has_input_locations() const { return input_locations_ != nullptr; }
1836  DCHECK_NOT_NULL(input_locations_);
1837  return input_locations_;
1838  }
1839  void InitializeInputLocations(Zone* zone, size_t count);
1840 
1841  Label* deopt_entry_label() { return &deopt_entry_label_; }
1842 
1843  int translation_index() const { return translation_index_; }
1844  void set_translation_index(int index) { translation_index_ = index; }
1845 
1846 #ifdef DEBUG
1847  size_t input_location_count() { return input_location_count_; }
1848 #endif // DEBUG
1849 
1850  private:
1851  DeoptFrame top_frame_;
1852  const compiler::FeedbackSource feedback_to_update_;
1853  InputLocation* input_locations_ = nullptr;
1854 #ifdef DEBUG
1855  size_t input_location_count_ = 0;
1856 #endif // DEBUG
1857  Label deopt_entry_label_;
1858  int translation_index_ = -1;
1859 };
1860 
1865 };
1866 
1867 class EagerDeoptInfo : public DeoptInfo {
1868  public:
1872 
1873  DeoptimizeReason reason() const { return reason_; }
1875 
1876  template <typename Function>
1877  void ForEachInput(Function&& f);
1878  template <typename Function>
1879  void ForEachInput(Function&& f) const;
1880 
1881  private:
1882  DeoptimizeReason reason_ = DeoptimizeReason::kUnknown;
1883 };
1884 
1885 class LazyDeoptInfo : public DeoptInfo {
1886  public:
1891  result_location_(result_location),
1892  bitfield_(
1893  DeoptingCallReturnPcField::encode(kUninitializedCallReturnPc) |
1894  ResultSizeField::encode(result_size)) {}
1895 
1897  DCHECK(IsConsideredForResultLocation());
1898  return result_location_;
1899  }
1900  int result_size() const {
1901  DCHECK(IsConsideredForResultLocation());
1902  return ResultSizeField::decode(bitfield_);
1903  }
1904 
1906  bool HasResultLocation() const {
1907  DCHECK(IsConsideredForResultLocation());
1908  return result_location_.is_valid();
1909  }
1910 
1912  const ExceptionHandlerInfo* handler_info);
1913 
1916  kUninitializedCallReturnPc);
1917  return DeoptingCallReturnPcField::decode(bitfield_);
1918  }
1921  kUninitializedCallReturnPc);
1922  bitfield_ = DeoptingCallReturnPcField::update(bitfield_, pc);
1923  }
1924 
1927  int result_size);
1928 
1929  template <typename Function>
1930  void ForEachInput(Function&& f);
1931  template <typename Function>
1932  void ForEachInput(Function&& f) const;
1933 
1934  private:
1935 #ifdef DEBUG
1936  bool IsConsideredForResultLocation() const {
1937  switch (top_frame().type()) {
1939  // Interpreted frames obviously need a result location.
1940  return true;
1943  return false;
1945  // Normally if the function is going to be deoptimized then the top
1946  // frame should be an interpreted one, except for LazyDeoptContinuation
1947  // builtin.
1948  switch (top_frame().as_builtin_continuation().builtin_id()) {
1949  case Builtin::kGenericLazyDeoptContinuation:
1950  case Builtin::kGetIteratorWithFeedbackLazyDeoptContinuation:
1951  case Builtin::kCallIteratorWithFeedbackLazyDeoptContinuation:
1952  return true;
1953  default:
1954  return false;
1955  }
1956  }
1957  }
1958 #endif // DEBUG
1959 
1960  using DeoptingCallReturnPcField = base::BitField<unsigned int, 0, 30>;
1961  using ResultSizeField = DeoptingCallReturnPcField::Next<unsigned int, 2>;
1962 
1963  // The max code size is enforced by the various assemblers, but it's not
1964  // visible here, so static assert against the magic constant that we happen
1965  // to know is correct.
1966  static constexpr int kMaxCodeSize = 512 * MB;
1967  static constexpr unsigned int kUninitializedCallReturnPc =
1969  static_assert(DeoptingCallReturnPcField::is_valid(kMaxCodeSize));
1970  static_assert(kMaxCodeSize != kUninitializedCallReturnPc);
1971 
1972  // Lazy deopts can have at most two result registers -- temporarily three for
1973  // ForInPrepare.
1974  static_assert(ResultSizeField::kMax >= 3);
1975 
1976  interpreter::Register result_location_;
1977  uint32_t bitfield_;
1978 };
1979 
1981  public:
1983  enum Mode {
1986  };
1987 
1989  : catch_block_(), depth_(static_cast<int>(mode)), pc_offset_(-1) {}
1990 
1992  : catch_block_(catch_block_ref), depth_(depth), pc_offset_(-1) {
1995  }
1996 
1997  ExceptionHandlerInfo(BasicBlock* catch_block_ref, int depth)
1998  : catch_block_(catch_block_ref), depth_(depth), pc_offset_(-1) {}
1999 
2000  bool HasExceptionHandler() const { return depth_ != kNoExceptionHandler; }
2001 
2002  bool ShouldLazyDeopt() const { return depth_ == kLazyDeopt; }
2003 
2004  Label& trampoline_entry() { return trampoline_entry_; }
2005 
2006  BasicBlockRef* catch_block_ref_address() { return &catch_block_; }
2007 
2008  BasicBlock* catch_block() const { return catch_block_.block_ptr(); }
2009 
2010  int depth() const {
2011  DCHECK_NE(depth_, kNoExceptionHandler);
2012  DCHECK_NE(depth_, kLazyDeopt);
2013  return depth_;
2014  }
2015 
2016  int pc_offset() const { return pc_offset_; }
2017  void set_pc_offset(int offset) {
2018  DCHECK_EQ(pc_offset_, -1);
2019  DCHECK_NE(offset, -1);
2020  pc_offset_ = offset;
2021  }
2022 
2023  private:
2024  BasicBlockRef catch_block_;
2025  Label trampoline_entry_;
2026  int depth_;
2027  int pc_offset_;
2028 
2029  ExceptionHandlerInfo* next_ = nullptr;
2030  ExceptionHandlerInfo** next() { return &next_; }
2031 
2032  friend List;
2034 };
2035 
2036 // Dummy type for the initial raw allocation.
2038 
2039 namespace detail {
2040 // Helper for getting the static opcode of a Node subclass. This is in a
2041 // "detail" namespace rather than in NodeBase because we can't template
2042 // specialize outside of namespace scopes before C++17.
2043 template <class T>
2045 
2046 #define DEF_OPCODE_OF(Name) \
2047  template <> \
2048  struct opcode_of_helper<Name> { \
2049  static constexpr Opcode value = Opcode::k##Name; \
2050  };
2052 #undef DEF_OPCODE_OF
2053 
2054 template <typename T>
2055 constexpr T* ObjectPtrBeforeAddress(void* address) {
2056  char* address_as_char_ptr = reinterpret_cast<char*>(address);
2057  char* object_ptr_as_char_ptr = address_as_char_ptr - sizeof(T);
2058  return reinterpret_cast<T*>(object_ptr_as_char_ptr);
2059 }
2060 
2061 template <typename T>
2062 constexpr const T* ObjectPtrBeforeAddress(const void* address) {
2063  const char* address_as_char_ptr = reinterpret_cast<const char*>(address);
2064  const char* object_ptr_as_char_ptr = address_as_char_ptr - sizeof(T);
2065  return reinterpret_cast<const T*>(object_ptr_as_char_ptr);
2066 }
2067 
2068 } // namespace detail
2069 
2070 #define DEOPTIMIZE_REASON_FIELD \
2071  private: \
2072  using ReasonField = \
2073  NextBitField<DeoptimizeReason, base::bits::WhichPowerOfTwo<size_t>( \
2074  base::bits::RoundUpToPowerOfTwo32( \
2075  kDeoptimizeReasonCount))>; \
2076  \
2077  public: \
2078  DeoptimizeReason deoptimize_reason() const { \
2079  return ReasonField::decode(bitfield()); \
2080  }
2081 
2082 struct KnownNodeAspects;
2083 class NodeBase : public ZoneObject {
2084  private:
2085  // Bitfield specification.
2087  static_assert(OpcodeField::is_valid(kLastOpcode));
2088  using OpPropertiesField =
2094  static_assert(InputCountField::kShift == 32);
2095 
2096  protected:
2097  // Reserved for intermediate superclasses such as ValueNode.
2099  // Subclasses may use the remaining bitfield bits.
2100  template <class T, int size>
2102 
2103  static constexpr int kMaxInputs = InputCountField::kMax;
2104 
2105  public:
2106  template <class T>
2108 
2109  template <class Derived, typename... Args>
2110  static Derived* New(Zone* zone, std::initializer_list<ValueNode*> inputs,
2111  Args&&... args) {
2112  static_assert(Derived::kProperties.is_conversion(),
2113  "This method does not implicitly convert input types. Use "
2114  "MaglevGraphBuilder::AddNewNode instead or NodeBase::New and "
2115  "initialize and convert inputs manually.");
2116  Derived* node =
2117  Allocate<Derived>(zone, inputs.size(), std::forward<Args>(args)...);
2118 
2119  int i = 0;
2120  for (ValueNode* input : inputs) {
2122  node->set_input(i++, input);
2123  }
2124 
2125  return node;
2126  }
2127 
2128  // Inputs must be initialized manually.
2129  template <class Derived, typename... Args>
2130  static Derived* New(Zone* zone, size_t input_count, Args&&... args) {
2131  Derived* node =
2132  Allocate<Derived>(zone, input_count, std::forward<Args>(args)...);
2133  return node;
2134  }
2135 
2136  // Overwritten by subclasses.
2137  static constexpr OpProperties kProperties =
2139 
2140  constexpr Opcode opcode() const { return OpcodeField::decode(bitfield_); }
2141  constexpr OpProperties properties() const {
2142  return OpPropertiesField::decode(bitfield_);
2143  }
2145  bitfield_ = OpPropertiesField::update(bitfield_, properties);
2146  }
2147 
2148  inline void set_input(int index, ValueNode* node);
2149 
2150  template <class T>
2151  constexpr bool Is() const;
2152 
2153  template <class T>
2154  constexpr T* Cast() {
2155  DCHECK(Is<T>());
2156  return static_cast<T*>(this);
2157  }
2158  template <class T>
2159  constexpr const T* Cast() const {
2160  DCHECK(Is<T>());
2161  return static_cast<const T*>(this);
2162  }
2163  template <class T>
2164  constexpr T* TryCast() {
2165  return Is<T>() ? static_cast<T*>(this) : nullptr;
2166  }
2167 
2168  template <class T>
2169  constexpr const T* TryCast() const {
2170  return Is<T>() ? static_cast<const T*>(this) : nullptr;
2171  }
2172 
2173  constexpr bool has_inputs() const { return input_count() > 0; }
2174  constexpr int input_count() const {
2175  static_assert(InputCountField::kMax <= kMaxInt);
2176  return static_cast<int>(InputCountField::decode(bitfield_));
2177  }
2178 
2179  constexpr Input& input(int index) {
2181  return *(input_base() - index);
2182  }
2183  constexpr const Input& input(int index) const {
2185  return *(input_base() - index);
2186  }
2187 
2188  std::optional<int32_t> TryGetInt32ConstantInput(int index);
2189 
2190  // Input iterators, use like:
2191  //
2192  // for (Input& input : *node) { ... }
2193  constexpr auto begin() { return std::make_reverse_iterator(&input(-1)); }
2194  constexpr auto end() {
2195  return std::make_reverse_iterator(&input(input_count() - 1));
2196  }
2197 
2198  constexpr bool has_id() const { return id_ != kInvalidNodeId; }
2199  constexpr NodeIdT id() const {
2200  DCHECK_NE(id_, kInvalidNodeId);
2201  return id_;
2202  }
2203  void set_id(NodeIdT id) {
2204  DCHECK_EQ(id_, kInvalidNodeId);
2205  DCHECK_NE(id, kInvalidNodeId);
2206  id_ = id;
2207  }
2208 
2209  template <typename RegisterT>
2210  uint8_t num_temporaries_needed() const {
2211  if constexpr (std::is_same_v<RegisterT, Register>) {
2212  return NumTemporariesNeededField::decode(bitfield_);
2213  } else {
2214  return NumDoubleTemporariesNeededField::decode(bitfield_);
2215  }
2216  }
2217 
2218  template <typename RegisterT>
2220  return owner_or_temporaries_.temporaries<RegisterT>();
2221  }
2222  RegList& general_temporaries() { return temporaries<Register>(); }
2223  DoubleRegList& double_temporaries() { return temporaries<DoubleRegister>(); }
2224 
2225  template <typename RegisterT>
2227  owner_or_temporaries_.temporaries<RegisterT>() = list;
2228  }
2229 
2231 
2232  // Some parts of Maglev require a specific iteration order of the inputs (such
2233  // as UseMarkingProcessor::MarkInputUses or
2234  // StraightForwardRegisterAllocator::AssignInputs). For such cases,
2235  // `ForAllInputsInRegallocAssignmentOrder` can be called with a callback `f`
2236  // that will be called for each input in the "correct" order.
2237  template <typename Function>
2239 
2240  void Print(std::ostream& os, MaglevGraphLabeller*,
2241  bool skip_targets = false) const;
2242 
2243  // For GDB: Print any Node with `print node->Print()`.
2244  void Print() const;
2245 
2247  DCHECK(properties().can_eager_deopt() ||
2248  properties().is_deopt_checkpoint());
2249  DCHECK(!properties().can_lazy_deopt());
2250  return reinterpret_cast<EagerDeoptInfo*>(deopt_info_address());
2251  }
2252 
2254  DCHECK(properties().can_lazy_deopt());
2255  DCHECK(!properties().can_eager_deopt());
2256  return reinterpret_cast<LazyDeoptInfo*>(deopt_info_address());
2257  }
2258 
2260  DCHECK(properties().needs_register_snapshot());
2261  return *reinterpret_cast<RegisterSnapshot*>(register_snapshot_address());
2262  }
2263 
2265  DCHECK(properties().can_throw());
2266  return reinterpret_cast<ExceptionHandlerInfo*>(exception_handler_address());
2267  }
2268 
2270  DCHECK(properties().needs_register_snapshot());
2271  *reinterpret_cast<RegisterSnapshot*>(register_snapshot_address()) =
2272  snapshot;
2273  }
2274 
2275  inline void change_input(int index, ValueNode* node);
2276 
2278  DCHECK_EQ(opcode(), Opcode::kPhi);
2279  bitfield_ = OpPropertiesField::update(
2280  bitfield_, properties().WithNewValueRepresentation(new_repr));
2281  }
2282 
2283  void set_opcode(Opcode new_opcode) {
2284  bitfield_ = OpcodeField::update(bitfield_, new_opcode);
2285  }
2286 
2287  void CopyEagerDeoptInfoOf(NodeBase* other, Zone* zone) {
2288  new (eager_deopt_info())
2289  EagerDeoptInfo(zone, other->eager_deopt_info()->top_frame(),
2290  other->eager_deopt_info()->feedback_to_update());
2291  }
2292 
2293  void SetEagerDeoptInfo(Zone* zone, DeoptFrame deopt_frame,
2294  compiler::FeedbackSource feedback_to_update =
2296  DCHECK(properties().can_eager_deopt() ||
2297  properties().is_deopt_checkpoint());
2298  new (eager_deopt_info())
2299  EagerDeoptInfo(zone, deopt_frame, feedback_to_update);
2300  }
2301 
2302  template <typename NodeT>
2303  void OverwriteWith() {
2304  OverwriteWith(NodeBase::opcode_of<NodeT>, NodeT::kProperties);
2305  }
2306 
2308  Opcode new_opcode,
2309  std::optional<OpProperties> maybe_new_properties = std::nullopt) {
2310  OpProperties new_properties = maybe_new_properties.has_value()
2311  ? maybe_new_properties.value()
2312  : StaticPropertiesForOpcode(new_opcode);
2313 #ifdef DEBUG
2314  CheckCanOverwriteWith(new_opcode, new_properties);
2315 #endif
2316  set_opcode(new_opcode);
2317  set_properties(new_properties);
2318  }
2319 
2320  inline void OverwriteWithIdentityTo(ValueNode* node);
2321 
2322  auto options() const { return std::tuple{}; }
2323 
2326 
2327  void set_owner(BasicBlock* block) { owner_or_temporaries_ = block; }
2328 
2329  BasicBlock* owner() const { return owner_or_temporaries_.owner(); }
2330 
2331  void InitTemporaries() { owner_or_temporaries_.InitReglist(); }
2332 
2333  protected:
2334  explicit NodeBase(uint64_t bitfield) : bitfield_(bitfield) {}
2335 
2336  // Allow updating bits above NextBitField from subclasses
2337  constexpr uint64_t bitfield() const { return bitfield_; }
2338  void set_bitfield(uint64_t new_bitfield) {
2339 #ifdef DEBUG
2340  // Make sure that all the base bitfield bits (all bits before the next
2341  // bitfield start, excluding any spare bits) are equal in the new value.
2342  const uint64_t base_bitfield_mask =
2343  ((uint64_t{1} << NextBitField<bool, 1>::kShift) - 1) &
2344  ~ReservedField::kMask;
2345  DCHECK_EQ(bitfield_ & base_bitfield_mask,
2346  new_bitfield & base_bitfield_mask);
2347 #endif
2348  bitfield_ = new_bitfield;
2349  }
2350 
2351  constexpr Input* input_base() {
2352  return detail::ObjectPtrBeforeAddress<Input>(this);
2353  }
2354  constexpr const Input* input_base() const {
2355  return detail::ObjectPtrBeforeAddress<Input>(this);
2356  }
2357  Input* last_input() { return &input(input_count() - 1); }
2358  const Input* last_input() const { return &input(input_count() - 1); }
2359 
2361  return reinterpret_cast<Address>(last_input());
2362  }
2363 
2364  inline void initialize_input_null(int index);
2365 
2366  // For nodes that don't have data past the input, allow trimming the input
2367  // count. This is used by Phis to reduce inputs when merging in dead control
2368  // flow.
2369  void reduce_input_count(int num = 1) {
2370  DCHECK_EQ(opcode(), Opcode::kPhi);
2371  DCHECK_GE(input_count(), num);
2372  DCHECK(!properties().can_lazy_deopt());
2373  DCHECK(!properties().can_eager_deopt());
2374  bitfield_ = InputCountField::update(bitfield_, input_count() - num);
2375  }
2376 
2377  // Specify that there need to be a certain number of registers free (i.e.
2378  // usable as scratch registers) on entry into this node.
2379  //
2380  // Does not include any registers requested by RequireSpecificTemporary.
2382  DCHECK_EQ(num_temporaries_needed<Register>(), 0);
2383  bitfield_ = NumTemporariesNeededField::update(bitfield_, value);
2384  }
2385 
2387  DCHECK_EQ(num_temporaries_needed<DoubleRegister>(), 0);
2388  bitfield_ = NumDoubleTemporariesNeededField::update(bitfield_, value);
2389  }
2390 
2391  // Require that a specific register is free (and therefore clobberable) by the
2392  // entry into this node.
2395  }
2396 
2399  }
2400 
2401  private:
2402  template <class Derived, typename... Args>
2403  static Derived* Allocate(Zone* zone, size_t input_count, Args&&... args) {
2404  static_assert(
2405  !Derived::kProperties.can_eager_deopt() ||
2406  !Derived::kProperties.can_lazy_deopt(),
2407  "The current deopt info representation, at the end of inputs, requires "
2408  "that we cannot have both lazy and eager deopts on a node. If we ever "
2409  "need this, we have to update accessors to check node->properties() "
2410  "for which deopts are active.");
2411  constexpr size_t size_before_inputs =
2412  ExceptionHandlerInfoSize(Derived::kProperties) +
2413  RegisterSnapshotSize(Derived::kProperties) +
2414  EagerDeoptInfoSize(Derived::kProperties) +
2415  LazyDeoptInfoSize(Derived::kProperties);
2416 
2417  static_assert(IsAligned(size_before_inputs, alignof(Input)));
2418  const size_t size_before_node =
2419  size_before_inputs + input_count * sizeof(Input);
2420 
2421  DCHECK(IsAligned(size_before_inputs, alignof(Derived)));
2422  const size_t size = size_before_node + sizeof(Derived);
2423  intptr_t raw_buffer =
2424  reinterpret_cast<intptr_t>(zone->Allocate<NodeWithInlineInputs>(size));
2425 #ifdef DEBUG
2426  memset(reinterpret_cast<void*>(raw_buffer), 0, size);
2427 #endif
2428 
2429  void* node_buffer = reinterpret_cast<void*>(raw_buffer + size_before_node);
2430  uint64_t bitfield = OpcodeField::encode(opcode_of<Derived>) |
2431  OpPropertiesField::encode(Derived::kProperties) |
2433  Derived* node =
2434  new (node_buffer) Derived(bitfield, std::forward<Args>(args)...);
2435  return node;
2436  }
2437 
2438  static constexpr size_t ExceptionHandlerInfoSize(OpProperties properties) {
2439  return RoundUp<alignof(Input)>(
2440  properties.can_throw() ? sizeof(ExceptionHandlerInfo) : 0);
2441  }
2442 
2443  static constexpr size_t RegisterSnapshotSize(OpProperties properties) {
2444  return RoundUp<alignof(Input)>(
2445  properties.needs_register_snapshot() ? sizeof(RegisterSnapshot) : 0);
2446  }
2447 
2448  static constexpr size_t EagerDeoptInfoSize(OpProperties properties) {
2449  return RoundUp<alignof(Input)>(
2451  ? sizeof(EagerDeoptInfo)
2452  : 0);
2453  }
2454 
2455  static constexpr size_t LazyDeoptInfoSize(OpProperties properties) {
2456  return RoundUp<alignof(Input)>(
2457  properties.can_lazy_deopt() ? sizeof(LazyDeoptInfo) : 0);
2458  }
2459 
2460  // Returns the position of deopt info if it exists, otherwise returns
2461  // its position as if DeoptInfo size were zero.
2462  Address deopt_info_address() const {
2463  DCHECK(!properties().can_eager_deopt() || !properties().can_lazy_deopt());
2464  size_t extra =
2465  EagerDeoptInfoSize(properties()) + LazyDeoptInfoSize(properties());
2466  return last_input_address() - extra;
2467  }
2468 
2469  // Returns the position of register snapshot if it exists, otherwise returns
2470  // its position as if RegisterSnapshot size were zero.
2471  Address register_snapshot_address() const {
2472  size_t extra = RegisterSnapshotSize(properties());
2473  return deopt_info_address() - extra;
2474  }
2475 
2476  // Returns the position of exception handler info if it exists, otherwise
2477  // returns its position as if ExceptionHandlerInfo size were zero.
2478  Address exception_handler_address() const {
2479  size_t extra = ExceptionHandlerInfoSize(properties());
2480  return register_snapshot_address() - extra;
2481  }
2482 
2483  void CheckCanOverwriteWith(Opcode new_opcode, OpProperties new_properties);
2484 
2485  uint64_t bitfield_;
2486  NodeIdT id_ = kInvalidNodeId;
2487 
2488  struct OwnerOrTemporaries {
2489  BasicBlock* owner() const {
2490  DCHECK_EQ(state_, State::kOwner);
2491  return store_.owner_;
2492  }
2493 
2494  template <typename RegisterT>
2495  RegListBase<RegisterT>& temporaries() {
2496  DCHECK_EQ(state_, State::kReglist);
2497  if constexpr (std::is_same_v<RegisterT, Register>) {
2498  return store_.regs_.temporaries_;
2499  } else {
2500  return store_.regs_.double_temporaries_;
2501  }
2502  }
2503 
2504  BasicBlock* operator=(BasicBlock* owner) {
2505 #ifdef DEBUG
2506  DCHECK(state_ == State::kNull || state_ == State::kOwner);
2507  state_ = State::kOwner;
2508 #endif
2509  return store_.owner_ = owner;
2510  }
2511 
2512  void InitReglist() {
2513 #ifdef DEBUG
2514  DCHECK(state_ == State::kNull || state_ == State::kOwner);
2515  state_ = State::kReglist;
2516 #endif
2517  store_.regs_.temporaries_ = RegList();
2518  store_.regs_.double_temporaries_ = DoubleRegList();
2519  }
2520 
2521  private:
2522  struct Regs {
2523  RegList temporaries_;
2524  DoubleRegList double_temporaries_;
2525  };
2526  union Store {
2527  Store() : owner_(nullptr) {}
2528  BasicBlock* owner_;
2529  Regs regs_;
2530  };
2531  Store store_;
2532 #ifdef DEBUG
2533  enum class State{
2534  kNull,
2535  kOwner,
2536  kReglist,
2537  };
2538  State state_ = State::kNull;
2539 #endif
2540  };
2541 
2542  OwnerOrTemporaries owner_or_temporaries_;
2543 
2544  NodeBase() = delete;
2545  NodeBase(const NodeBase&) = delete;
2546  NodeBase(NodeBase&&) = delete;
2547  NodeBase& operator=(const NodeBase&) = delete;
2548  NodeBase& operator=(NodeBase&&) = delete;
2549 };
2550 
2551 template <class T>
2552 constexpr bool NodeBase::Is() const {
2553  return opcode() == opcode_of<T>;
2554 }
2555 
2556 // Specialized sub-hierarchy type checks.
2557 template <>
2558 constexpr bool NodeBase::Is<ValueNode>() const {
2559  return IsValueNode(opcode());
2560 }
2561 template <>
2562 constexpr bool NodeBase::Is<ControlNode>() const {
2563  return IsControlNode(opcode());
2564 }
2565 template <>
2566 constexpr bool NodeBase::Is<BranchControlNode>() const {
2567  return IsBranchControlNode(opcode());
2568 }
2569 template <>
2570 constexpr bool NodeBase::Is<ConditionalControlNode>() const {
2571  return IsConditionalControlNode(opcode());
2572 }
2573 template <>
2574 constexpr bool NodeBase::Is<UnconditionalControlNode>() const {
2576 }
2577 template <>
2578 constexpr bool NodeBase::Is<TerminalControlNode>() const {
2579  return IsTerminalControlNode(opcode());
2580 }
2581 
2582 void CheckValueInputIs(const NodeBase* node, int i,
2583  ValueRepresentation expected,
2584  MaglevGraphLabeller* graph_labeller);
2585 
2586 // The Node class hierarchy contains all non-control nodes.
2587 class Node : public NodeBase {
2588  public:
2589  inline ValueLocation& result();
2590 
2591  static constexpr bool participate_in_cse(Opcode op) {
2593  !IsConstantNode(op) && !IsControlNode(op) && !IsZeroCostNode(op) &&
2594  // The following are already precisely tracked by known_node_aspects
2595  // and tracking them with CSE would just waste time.
2596  op != Opcode::kCheckMaps;
2597  }
2598 
2599  static constexpr bool needs_epoch_check(Opcode op) {
2600  return StaticPropertiesForOpcode(op).can_read();
2601  }
2602 
2603  protected:
2604  using NodeBase::NodeBase;
2605 };
2606 
2607 // All non-control nodes with a result.
2608 class ValueNode : public Node {
2609  private:
2611 
2612  protected:
2614 
2615  public:
2617  const ValueLocation& result() const { return result_; }
2618 
2619  int use_count() const {
2620  // Invalid to check use_count externally once an id is allocated.
2621  DCHECK(!has_id());
2622  return use_count_;
2623  }
2624  bool is_used() const { return use_count_ > 0; }
2625  bool unused_inputs_were_visited() const { return use_count_ == -1; }
2626  void add_use() {
2627  // Make sure a saturated use count won't overflow.
2629  use_count_++;
2630  }
2631  inline void remove_use();
2632  // Avoid revisiting nodes when processing an unused node's inputs, by marking
2633  // it as visited.
2635  DCHECK_EQ(use_count_, 0);
2636  use_count_ = -1;
2637  }
2638 
2640 
2642 
2643  bool has_hint() { return !hint_.IsInvalid(); }
2644 
2645  template <typename RegisterT>
2646  RegisterT GetRegisterHint() {
2647  if (hint_.IsInvalid()) return RegisterT::no_reg();
2648  return RegisterT::from_code(
2649  compiler::UnallocatedOperand::cast(hint_).fixed_register_index());
2650  }
2651 
2653  DCHECK(hint_.IsInvalid() || hint_.IsUnallocated());
2654  return hint_;
2655  }
2656 
2657  bool is_loadable() const {
2658  DCHECK_EQ(state_, kSpill);
2659  return spill_.IsConstant() || spill_.IsAnyStackSlot();
2660  }
2661 
2662  bool is_spilled() const {
2663  DCHECK_EQ(state_, kSpill);
2664  return spill_.IsAnyStackSlot();
2665  }
2666 
2667  void SetNoSpill();
2668  void SetConstantLocation();
2669 
2670  /* For constants only. */
2676 
2678 #ifdef DEBUG
2679  if (state_ == kLastUse) {
2680  state_ = kSpill;
2681  } else {
2682  DCHECK(!is_loadable());
2683  }
2684 #endif // DEBUG
2686  DCHECK(operand.IsAnyStackSlot());
2687  spill_ = operand;
2689  }
2690 
2692  DCHECK(is_spilled());
2694  }
2695 
2697  DCHECK_EQ(state_, kSpill);
2698  DCHECK(is_loadable());
2699  return spill_;
2700  }
2701 
2702  void record_next_use(NodeIdT id, InputLocation* input_location) {
2703  DCHECK_EQ(state_, kLastUse);
2704  DCHECK_NE(id, kInvalidNodeId);
2705  DCHECK_LT(start_id(), id);
2707  end_id_ = id;
2709  last_uses_next_use_id_ = input_location->get_next_use_id_address();
2710  DCHECK_EQ(*last_uses_next_use_id_, kInvalidNodeId);
2711  }
2712 
2713  struct LiveRange {
2714  NodeIdT start = kInvalidNodeId;
2715  NodeIdT end = kInvalidNodeId; // Inclusive.
2716  };
2717 
2718  bool has_valid_live_range() const { return end_id_ != 0; }
2719  LiveRange live_range() const { return {start_id(), end_id_}; }
2720  NodeIdT current_next_use() const { return next_use_; }
2721 
2722  // The following methods should only be used during register allocation, to
2723  // mark the _current_ state of this Node according to the register allocator.
2725 
2726  bool has_no_more_uses() const { return next_use_ == kInvalidNodeId; }
2727 
2728  constexpr bool use_double_register() const {
2730  }
2731 
2732  constexpr bool is_tagged() const {
2733  return (properties().value_representation() ==
2735  }
2736 
2737 #ifdef V8_COMPRESS_POINTERS
2738  constexpr bool decompresses_tagged_result() const {
2740  }
2741 
2742  void SetTaggedResultNeedsDecompress() {
2743  static_assert(PointerCompressionIsEnabled());
2744 
2745  DCHECK_IMPLIES(!Is<Identity>(), is_tagged());
2746  DCHECK_IMPLIES(Is<Identity>(), input(0).node()->is_tagged());
2748  if (Is<Phi>()) {
2749  for (Input& input : *this) {
2750  // Avoid endless recursion by terminating on values already marked.
2751  if (input.node()->decompresses_tagged_result()) continue;
2752  input.node()->SetTaggedResultNeedsDecompress();
2753  }
2754  } else if (Is<Identity>()) {
2755  DCHECK_EQ(input_count(), 0);
2756  input(0).node()->SetTaggedResultNeedsDecompress();
2757  }
2758  }
2759 #else
2760  constexpr bool decompresses_tagged_result() const { return false; }
2761 #endif
2762 
2764  return properties().value_representation();
2765  }
2766 
2768  switch (properties().value_representation()) {
2780  }
2781  }
2782 
2784  if (use_double_register()) {
2785  double_registers_with_result_ = kEmptyDoubleRegList;
2786  } else {
2787  registers_with_result_ = kEmptyRegList;
2788  }
2789  }
2790 
2794  }
2798  }
2799 
2803  }
2807  }
2808 
2809  template <typename T>
2811 
2812  int num_registers() const {
2813  if (use_double_register()) {
2815  }
2816  return registers_with_result_.Count();
2817  }
2818  bool has_register() const {
2819  if (use_double_register()) {
2820  return double_registers_with_result_ != kEmptyDoubleRegList;
2821  }
2822  return registers_with_result_ != kEmptyRegList;
2823  }
2826  return registers_with_result_.has(reg);
2827  }
2831  }
2832 
2833  template <typename T>
2835  if constexpr (std::is_same_v<T, DoubleRegister>) {
2838  } else {
2840  return registers_with_result_;
2841  }
2842  }
2843 
2845  if (has_register()) {
2848  FirstRegisterCode());
2849  }
2850  CHECK(is_loadable());
2851  return spill_;
2852  }
2853 
2854  protected:
2855  explicit ValueNode(uint64_t bitfield)
2856  : Node(bitfield),
2858  hint_(compiler::InstructionOperand()),
2859  use_count_(0)
2860 #ifdef DEBUG
2861  ,
2862  state_(kLastUse)
2863 #endif // DEBUG
2864  {
2866  }
2867 
2868  int FirstRegisterCode() const {
2869  if (use_double_register()) {
2871  }
2872  return registers_with_result_.first().code();
2873  }
2874 
2875  // Rename for better pairing with `end_id`.
2876  NodeIdT start_id() const { return id(); }
2877 
2878  NodeIdT end_id_ = kInvalidNodeId;
2879  NodeIdT next_use_ = kInvalidNodeId;
2881  union {
2884  };
2885  union {
2886  // Pointer to the current last use's next_use_id field. Most of the time
2887  // this will be a pointer to an Input's next_use_id_ field, but it's
2888  // initialized to this node's next_use_ to track the first use.
2891  };
2893  // TODO(leszeks): Union this into another field.
2895 #ifdef DEBUG
2896  enum {kLastUse, kSpill} state_;
2897 #endif // DEBUG
2898 };
2899 
2901  // Should already be null in debug, make sure it's null on release too.
2902  DCHECK_EQ(input(index).node(), nullptr);
2903  new (&input(index)) Input(nullptr);
2904 }
2905 
2908  DCHECK_EQ(input(index).node(), nullptr);
2909  node->add_use();
2910  new (&input(index)) Input(node);
2911 }
2912 
2913 template <>
2916  return std::exchange(registers_with_result_, kEmptyRegList);
2917 }
2918 
2919 template <>
2922  return std::exchange(double_registers_with_result_, kEmptyDoubleRegList);
2923 }
2924 
2926  DCHECK(Is<ValueNode>());
2927  return Cast<ValueNode>()->result();
2928 }
2929 
2930 // Mixin for a node with known class (and therefore known opcode and static
2931 // properties), but possibly unknown numbers of inputs.
2932 template <typename Base, typename Derived>
2933 class NodeTMixin : public Base {
2934  public:
2935  // Shadowing for static knowledge.
2936  constexpr Opcode opcode() const { return NodeBase::opcode_of<Derived>; }
2937  constexpr const OpProperties& properties() const {
2938  return Derived::kProperties;
2939  }
2940 
2941  template <typename... Args>
2942  static Derived* New(Zone* zone, std::initializer_list<ValueNode*> inputs,
2943  Args&&... args) {
2944  return NodeBase::New<Derived>(zone, inputs, std::forward<Args>...);
2945  }
2946  template <typename... Args>
2947  static Derived* New(Zone* zone, size_t input_count, Args&&... args) {
2948  return NodeBase::New<Derived>(zone, input_count, std::forward<Args>...);
2949  }
2950 
2951  protected:
2952  template <typename... Args>
2953  explicit NodeTMixin(uint64_t bitfield, Args&&... args)
2954  : Base(bitfield, std::forward<Args>(args)...) {
2955  DCHECK_EQ(this->NodeBase::opcode(), NodeBase::opcode_of<Derived>);
2956  DCHECK_EQ(this->NodeBase::properties(), Derived::kProperties);
2957  }
2958 };
2959 
2960 namespace detail {
2961 // Helper class for defining input types as a std::array, but without
2962 // accidental initialisation with the wrong sized initializer_list.
2963 template <size_t Size>
2964 class ArrayWrapper : public std::array<ValueRepresentation, Size> {
2965  public:
2966  template <typename... Args>
2967  explicit constexpr ArrayWrapper(Args&&... args)
2968  : std::array<ValueRepresentation, Size>({args...}) {
2969  static_assert(sizeof...(args) == Size);
2970  }
2971 };
2973 } // namespace detail
2974 
2975 // Mixin for a node with known class (and therefore known opcode and static
2976 // properties), and known numbers of inputs.
2977 template <size_t InputCount, typename Base, typename Derived>
2978 class FixedInputNodeTMixin : public NodeTMixin<Base, Derived> {
2979  public:
2980  static constexpr size_t kInputCount = InputCount;
2981 
2982  // Shadowing for static knowledge.
2983  constexpr bool has_inputs() const { return input_count() > 0; }
2984  constexpr uint16_t input_count() const { return kInputCount; }
2985  constexpr auto end() {
2986  return std::make_reverse_iterator(&this->input(input_count() - 1));
2987  }
2988 
2989  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const {
2990  if constexpr (kInputCount != 0) {
2991  static_assert(
2992  std::is_same_v<const InputTypes, decltype(Derived::kInputTypes)>);
2993  static_assert(kInputCount == Derived::kInputTypes.size());
2994  for (int i = 0; i < static_cast<int>(kInputCount); ++i) {
2995  CheckValueInputIs(this, i, Derived::kInputTypes[i], graph_labeller);
2996  }
2997  }
2998  }
2999 
3000 #ifdef V8_COMPRESS_POINTERS
3001  void MarkTaggedInputsAsDecompressing() const {
3002  if constexpr (kInputCount != 0) {
3003  static_assert(
3004  std::is_same_v<const InputTypes, decltype(Derived::kInputTypes)>);
3005  static_assert(kInputCount == Derived::kInputTypes.size());
3006  for (int i = 0; i < static_cast<int>(kInputCount); ++i) {
3007  if (Derived::kInputTypes[i] == ValueRepresentation::kTagged) {
3008  ValueNode* input_node = this->input(i).node();
3009  input_node->SetTaggedResultNeedsDecompress();
3010  }
3011  }
3012  }
3013  }
3014 #endif
3015 
3016  protected:
3019 
3020  template <typename... Args>
3021  explicit FixedInputNodeTMixin(uint64_t bitfield, Args&&... args)
3022  : NodeTMixin<Base, Derived>(bitfield, std::forward<Args>(args)...) {
3023  DCHECK_EQ(this->NodeBase::input_count(), kInputCount);
3024  }
3025 };
3026 
3027 template <class T, class = void>
3028 struct IsFixedInputNode : public std::false_type {};
3029 template <class T>
3030 struct IsFixedInputNode<T, std::void_t<decltype(T::kInputCount)>>
3031  : public std::true_type {};
3032 
3033 template <class Derived>
3035 
3036 template <class Derived>
3038 
3039 template <size_t InputCount, class Derived>
3042 
3043 template <size_t InputCount, class Derived>
3046 
3047 class Identity : public FixedInputValueNodeT<1, Identity> {
3049 
3050  public:
3052 
3053  explicit Identity(uint64_t bitfield) : Base(bitfield) {}
3054 
3056  // Identity is valid for all input types.
3057  }
3058 #ifdef V8_COMPRESS_POINTERS
3059  void MarkTaggedInputsAsDecompressing() {
3060  // Do not mark inputs as decompressing here, since we don't yet know whether
3061  // this Phi needs decompression. Instead, let
3062  // Node::SetTaggedResultNeedsDecompress pass through phis.
3063  }
3064 #endif
3067  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3068 };
3069 
3070 template <class Derived, Operation kOperation>
3071 class UnaryWithFeedbackNode : public FixedInputValueNodeT<1, Derived> {
3073 
3074  public:
3075  // The implementation currently calls runtime.
3077  static constexpr
3079 
3080  static constexpr int kOperandIndex = 0;
3083 
3084  protected:
3085  explicit UnaryWithFeedbackNode(uint64_t bitfield,
3087  : Base(bitfield), feedback_(feedback) {}
3088 
3091  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3092 
3094 };
3095 
3096 template <class Derived, Operation kOperation>
3097 class BinaryWithFeedbackNode : public FixedInputValueNodeT<2, Derived> {
3099 
3100  public:
3101  // The implementation currently calls runtime.
3103  static constexpr typename Base::InputTypes kInputTypes{
3105 
3106  static constexpr int kLeftIndex = 0;
3107  static constexpr int kRightIndex = 1;
3111 
3112  protected:
3113  BinaryWithFeedbackNode(uint64_t bitfield,
3115  : Base(bitfield), feedback_(feedback) {}
3116 
3119  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3120 
3122 };
3123 
3124 #define DEF_OPERATION_WITH_FEEDBACK_NODE(Name, Super, OpName) \
3125  class Name : public Super<Name, Operation::k##OpName> { \
3126  using Base = Super<Name, Operation::k##OpName>; \
3127  \
3128  public: \
3129  Name(uint64_t bitfield, const compiler::FeedbackSource& feedback) \
3130  : Base(bitfield, feedback) {} \
3131  int MaxCallStackArgs() const { return 0; } \
3132  void SetValueLocationConstraints(); \
3133  void GenerateCode(MaglevAssembler*, const ProcessingState&); \
3134  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
3135  };
3136 
3137 #define DEF_UNARY_WITH_FEEDBACK_NODE(Name) \
3138  DEF_OPERATION_WITH_FEEDBACK_NODE(Generic##Name, UnaryWithFeedbackNode, Name)
3139 #define DEF_BINARY_WITH_FEEDBACK_NODE(Name) \
3140  DEF_OPERATION_WITH_FEEDBACK_NODE(Generic##Name, BinaryWithFeedbackNode, Name)
3144 #undef DEF_UNARY_WITH_FEEDBACK_NODE
3145 #undef DEF_BINARY_WITH_FEEDBACK_NODE
3146 #undef DEF_OPERATION_WITH_FEEDBACK_NODE
3147 
3148 template <class Derived, Operation kOperation>
3151 
3152  public:
3153  static constexpr OpProperties kProperties =
3155  static constexpr typename Base::InputTypes kInputTypes{
3157 
3158  static constexpr int kLeftIndex = 0;
3159  static constexpr int kRightIndex = 1;
3162 
3163  protected:
3164  explicit Int32BinaryWithOverflowNode(uint64_t bitfield) : Base(bitfield) {}
3165 
3166  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3167 };
3168 
3169 #define DEF_OPERATION_NODE(Name, Super, OpName) \
3170  class Name : public Super<Name, Operation::k##OpName> { \
3171  using Base = Super<Name, Operation::k##OpName>; \
3172  \
3173  public: \
3174  explicit Name(uint64_t bitfield) : Base(bitfield) {} \
3175  void SetValueLocationConstraints(); \
3176  void GenerateCode(MaglevAssembler*, const ProcessingState&); \
3177  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
3178  };
3179 
3180 #define DEF_INT32_BINARY_WITH_OVERFLOW_NODE(Name) \
3181  DEF_OPERATION_NODE(Int32##Name##WithOverflow, Int32BinaryWithOverflowNode, \
3182  Name)
3188 #undef DEF_INT32_BINARY_WITH_OVERFLOW_NODE
3189 
3190 template <class Derived, Operation kOperation>
3191 class Int32BinaryNode : public FixedInputValueNodeT<2, Derived> {
3193 
3194  public:
3196  static constexpr typename Base::InputTypes kInputTypes{
3198 
3199  static constexpr int kLeftIndex = 0;
3200  static constexpr int kRightIndex = 1;
3203 
3204  protected:
3205  explicit Int32BinaryNode(uint64_t bitfield) : Base(bitfield) {}
3206 };
3207 
3208 #define DEF_INT32_BINARY_NODE(Name) \
3209  DEF_OPERATION_NODE(Int32##Name, Int32BinaryNode, Name)
3210 DEF_INT32_BINARY_NODE(BitwiseAnd)
3211 DEF_INT32_BINARY_NODE(BitwiseOr)
3212 DEF_INT32_BINARY_NODE(BitwiseXor)
3213 DEF_INT32_BINARY_NODE(ShiftLeft)
3214 DEF_INT32_BINARY_NODE(ShiftRight)
3215 #undef DEF_INT32_BINARY_NODE
3216 
3217 class Int32BitwiseNot : public FixedInputValueNodeT<1, Int32BitwiseNot> {
3219 
3220  public:
3221  explicit Int32BitwiseNot(uint64_t bitfield) : Base(bitfield) {}
3222 
3224  static constexpr
3226 
3227  static constexpr int kValueIndex = 0;
3229 
3232  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3233 };
3234 
3235 template <class Derived, Operation kOperation>
3238 
3239  public:
3240  static constexpr OpProperties kProperties =
3242  static constexpr
3244 
3245  static constexpr int kValueIndex = 0;
3247 
3248  protected:
3249  explicit Int32UnaryWithOverflowNode(uint64_t bitfield) : Base(bitfield) {}
3250 };
3251 
3252 #define DEF_INT32_UNARY_WITH_OVERFLOW_NODE(Name) \
3253  DEF_OPERATION_NODE(Int32##Name##WithOverflow, Int32UnaryWithOverflowNode, \
3254  Name)
3255 
3259 #undef DEF_INT32_UNARY_WITH_OVERFLOW_NODE
3260 
3262  : public FixedInputValueNodeT<2, Int32ShiftRightLogical> {
3264 
3265  public:
3266  explicit Int32ShiftRightLogical(uint64_t bitfield) : Base(bitfield) {}
3267 
3268  // Unlike the other Int32 nodes, logical right shift returns a Uint32.
3270  static constexpr typename Base::InputTypes kInputTypes{
3272 
3273  static constexpr int kLeftIndex = 0;
3274  static constexpr int kRightIndex = 1;
3277 
3280  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3281 };
3282 
3283 class Int32Compare : public FixedInputValueNodeT<2, Int32Compare> {
3285 
3286  public:
3287  explicit Int32Compare(uint64_t bitfield, Operation operation)
3288  : Base(OperationBitField::update(bitfield, operation)) {}
3289 
3292 
3293  static constexpr int kLeftIndex = 0;
3294  static constexpr int kRightIndex = 1;
3297 
3298  constexpr Operation operation() const {
3299  return OperationBitField::decode(bitfield());
3300  }
3301 
3304  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3305 
3306  auto options() const { return std::tuple{operation()}; }
3307 
3308  private:
3309  using OperationBitField = NextBitField<Operation, 5>;
3310 };
3311 
3312 class Int32ToBoolean : public FixedInputValueNodeT<1, Int32ToBoolean> {
3314 
3315  public:
3316  explicit Int32ToBoolean(uint64_t bitfield, bool flip)
3317  : Base(FlipBitField::update(bitfield, flip)) {}
3318 
3320 
3321  Input& value() { return Node::input(0); }
3322 
3323  constexpr bool flip() const { return FlipBitField::decode(bitfield()); }
3324 
3327  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3328 
3329  auto options() const { return std::tuple{flip()}; }
3330 
3331  private:
3332  using FlipBitField = NextBitField<bool, 1>;
3333 };
3334 
3335 class IntPtrToBoolean : public FixedInputValueNodeT<1, IntPtrToBoolean> {
3337 
3338  public:
3339  explicit IntPtrToBoolean(uint64_t bitfield, bool flip)
3340  : Base(FlipBitField::update(bitfield, flip)) {}
3341 
3343 
3344  Input& value() { return Node::input(0); }
3345 
3346  constexpr bool flip() const { return FlipBitField::decode(bitfield()); }
3347 
3350  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3351 
3352  auto options() const { return std::tuple{flip()}; }
3353 
3354  private:
3355  using FlipBitField = NextBitField<bool, 1>;
3356 };
3357 
3359  : public FixedInputValueNodeT<1, CheckedSmiIncrement> {
3361 
3362  public:
3363  explicit CheckedSmiIncrement(uint64_t bitfield) : Base(bitfield) {}
3364 
3366  static constexpr
3368 
3369  static constexpr int kValueIndex = 0;
3371 
3374  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3375 };
3376 
3378  : public FixedInputValueNodeT<1, CheckedSmiDecrement> {
3380 
3381  public:
3382  explicit CheckedSmiDecrement(uint64_t bitfield) : Base(bitfield) {}
3383 
3385  static constexpr
3387 
3388  static constexpr int kValueIndex = 0;
3390 
3393  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3394 };
3395 
3396 template <class Derived, Operation kOperation>
3397 class Float64BinaryNode : public FixedInputValueNodeT<2, Derived> {
3399 
3400  public:
3402  static constexpr typename Base::InputTypes kInputTypes{
3404 
3405  static constexpr int kLeftIndex = 0;
3406  static constexpr int kRightIndex = 1;
3409 
3410  protected:
3411  explicit Float64BinaryNode(uint64_t bitfield) : Base(bitfield) {}
3412 
3413  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3414 };
3415 
3416 #define DEF_OPERATION_NODE_WITH_CALL(Name, Super, OpName) \
3417  class Name : public Super<Name, Operation::k##OpName> { \
3418  using Base = Super<Name, Operation::k##OpName>; \
3419  \
3420  public: \
3421  explicit Name(uint64_t bitfield) : Base(bitfield) {} \
3422  int MaxCallStackArgs() const; \
3423  void SetValueLocationConstraints(); \
3424  void GenerateCode(MaglevAssembler*, const ProcessingState&); \
3425  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
3426  };
3427 
3428 template <class Derived, Operation kOperation>
3431 
3432  public:
3433  static constexpr OpProperties kProperties =
3435  static constexpr typename Base::InputTypes kInputTypes{
3437 
3438  static constexpr int kLeftIndex = 0;
3439  static constexpr int kRightIndex = 1;
3442 
3443  protected:
3444  explicit Float64BinaryNodeWithCall(uint64_t bitfield) : Base(bitfield) {}
3445 
3446  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3447 };
3448 
3449 #define DEF_FLOAT64_BINARY_NODE(Name) \
3450  DEF_OPERATION_NODE(Float64##Name, Float64BinaryNode, Name)
3451 #define DEF_FLOAT64_BINARY_NODE_WITH_CALL(Name) \
3452  DEF_OPERATION_NODE_WITH_CALL(Float64##Name, Float64BinaryNodeWithCall, Name)
3455 DEF_FLOAT64_BINARY_NODE(Multiply)
3457 #if defined(V8_TARGET_ARCH_ARM64) || defined(V8_TARGET_ARCH_ARM) || \
3458  defined(V8_TARGET_ARCH_RISCV64)
3459 // On Arm/Arm64/Riscv64, floating point modulus is implemented with a call to a
3460 // C++ function, while on x64, it's implemented natively without call.
3462 #else
3463 DEF_FLOAT64_BINARY_NODE(Modulus)
3464 #endif
3466 #undef DEF_FLOAT64_BINARY_NODE
3467 #undef DEF_FLOAT64_BINARY_NODE_WITH_CALL
3468 
3469 #undef DEF_OPERATION_NODE
3470 #undef DEF_OPERATION_NODE_WITH_CALL
3471 
3472 class Float64Compare : public FixedInputValueNodeT<2, Float64Compare> {
3474 
3475  public:
3476  explicit Float64Compare(uint64_t bitfield, Operation operation)
3477  : Base(OperationBitField::update(bitfield, operation)) {}
3478 
3481 
3482  static constexpr int kLeftIndex = 0;
3483  static constexpr int kRightIndex = 1;
3486 
3487  constexpr Operation operation() const {
3488  return OperationBitField::decode(bitfield());
3489  }
3490 
3493  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3494 
3495  auto options() const { return std::tuple{operation()}; }
3496 
3497  private:
3498  using OperationBitField = NextBitField<Operation, 5>;
3499 };
3500 
3501 class Float64ToBoolean : public FixedInputValueNodeT<1, Float64ToBoolean> {
3503 
3504  public:
3505  explicit Float64ToBoolean(uint64_t bitfield, bool flip)
3506  : Base(FlipBitField::update(bitfield, flip)) {}
3507 
3508  static constexpr Base::InputTypes kInputTypes{
3510 
3511  Input& value() { return Node::input(0); }
3512 
3513  constexpr bool flip() const { return FlipBitField::decode(bitfield()); }
3514 
3517  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3518 
3519  auto options() const { return std::tuple{flip()}; }
3520 
3521  private:
3522  using FlipBitField = NextBitField<bool, 1>;
3523 };
3524 
3525 class Float64Negate : public FixedInputValueNodeT<1, Float64Negate> {
3527 
3528  public:
3529  explicit Float64Negate(uint64_t bitfield) : Base(bitfield) {}
3530 
3532  static constexpr
3534 
3535  Input& input() { return Node::input(0); }
3536 
3539  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3540 };
3541 
3542 #define IEEE_754_UNARY_LIST(V) \
3543  V(MathAcos, acos, Acos) \
3544  V(MathAcosh, acosh, Acosh) \
3545  V(MathAsin, asin, Asin) \
3546  V(MathAsinh, asinh, Asinh) \
3547  V(MathAtan, atan, Atan) \
3548  V(MathAtanh, atanh, Atanh) \
3549  V(MathCbrt, cbrt, Cbrt) \
3550  V(MathCos, cos, Cos) \
3551  V(MathCosh, cosh, Cosh) \
3552  V(MathExp, exp, Exp) \
3553  V(MathExpm1, expm1, Expm1) \
3554  V(MathLog, log, Log) \
3555  V(MathLog1p, log1p, Log1p) \
3556  V(MathLog10, log10, Log10) \
3557  V(MathLog2, log2, Log2) \
3558  V(MathSin, sin, Sin) \
3559  V(MathSinh, sinh, Sinh) \
3560  V(MathTan, tan, Tan) \
3561  V(MathTanh, tanh, Tanh)
3563  : public FixedInputValueNodeT<1, Float64Ieee754Unary> {
3565 
3566  public:
3567  enum class Ieee754Function : uint8_t {
3568 #define DECL_ENUM(MathName, ExtName, EnumName) k##EnumName,
3570 #undef DECL_ENUM
3571  };
3573  : Base(bitfield), ieee_function_(ieee_function) {}
3574 
3575  static constexpr OpProperties kProperties =
3577  static constexpr
3579 
3580  Input& input() { return Node::input(0); }
3581 
3582  int MaxCallStackArgs() const;
3585  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3586 
3587  auto options() const { return std::tuple{ieee_function_}; }
3588 
3589  Ieee754Function ieee_function() const { return ieee_function_; }
3591 
3592  private:
3593  Ieee754Function ieee_function_;
3594 };
3595 
3596 class CheckInt32IsSmi : public FixedInputNodeT<1, CheckInt32IsSmi> {
3598 
3599  public:
3600  explicit CheckInt32IsSmi(uint64_t bitfield) : Base(bitfield) {}
3601 
3603  static constexpr
3605 
3606  Input& input() { return Node::input(0); }
3607 
3610  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3611 };
3612 
3613 class CheckUint32IsSmi : public FixedInputNodeT<1, CheckUint32IsSmi> {
3615 
3616  public:
3617  explicit CheckUint32IsSmi(uint64_t bitfield) : Base(bitfield) {}
3618 
3620  static constexpr
3622 
3623  Input& input() { return Node::input(0); }
3624 
3627  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3628 };
3629 
3630 class CheckIntPtrIsSmi : public FixedInputNodeT<1, CheckIntPtrIsSmi> {
3632 
3633  public:
3634  explicit CheckIntPtrIsSmi(uint64_t bitfield) : Base(bitfield) {}
3635 
3637  static constexpr
3639 
3640  Input& input() { return Node::input(0); }
3641 
3644  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3645 };
3646 
3648  : public FixedInputNodeT<1, CheckHoleyFloat64IsSmi> {
3650 
3651  public:
3652  explicit CheckHoleyFloat64IsSmi(uint64_t bitfield) : Base(bitfield) {}
3653 
3655  static constexpr
3657 
3658  Input& input() { return Node::input(0); }
3659 
3662  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3663 };
3664 
3665 class CheckedSmiTagInt32 : public FixedInputValueNodeT<1, CheckedSmiTagInt32> {
3667 
3668  public:
3669  explicit CheckedSmiTagInt32(uint64_t bitfield) : Base(bitfield) {}
3670 
3671  static constexpr OpProperties kProperties =
3673  static constexpr
3675 
3676  Input& input() { return Node::input(0); }
3677 
3680  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3681 };
3682 
3683 // This is a check disguised as a conversion node so we can use it to override
3684 // untagging conversions.
3685 // TODO(olivf): Support overriding bigger with smaller instruction so we can use
3686 // CheckInt32IsSmi instead.
3688  : public FixedInputValueNodeT<1, CheckedSmiSizedInt32> {
3690 
3691  public:
3692  explicit CheckedSmiSizedInt32(uint64_t bitfield) : Base(bitfield) {}
3693 
3697  static constexpr
3699 
3700  Input& input() { return Node::input(0); }
3701 
3704  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3705 };
3706 
3708  : public FixedInputValueNodeT<1, CheckedSmiTagUint32> {
3710 
3711  public:
3712  explicit CheckedSmiTagUint32(uint64_t bitfield) : Base(bitfield) {}
3713 
3714  static constexpr OpProperties kProperties =
3716  static constexpr
3718 
3719  Input& input() { return Node::input(0); }
3720 
3723  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3724 };
3725 
3727  : public FixedInputValueNodeT<1, CheckedSmiTagIntPtr> {
3729 
3730  public:
3731  explicit CheckedSmiTagIntPtr(uint64_t bitfield) : Base(bitfield) {}
3732 
3733  static constexpr OpProperties kProperties =
3735  static constexpr
3737 
3738  Input& input() { return Node::input(0); }
3739 
3742  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3743 };
3744 
3745 // Input must guarantee to fit in a Smi.
3746 class UnsafeSmiTagInt32 : public FixedInputValueNodeT<1, UnsafeSmiTagInt32> {
3748 
3749  public:
3750  explicit UnsafeSmiTagInt32(uint64_t bitfield) : Base(bitfield) {}
3751 
3753  static constexpr
3755 
3756  Input& input() { return Node::input(0); }
3757 
3758 #ifdef V8_COMPRESS_POINTERS
3759  void MarkTaggedInputsAsDecompressing() {
3760  // No tagged inputs.
3761  }
3762 #endif
3763 
3766  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3767 };
3768 
3769 // Input must guarantee to fit in a Smi.
3770 class UnsafeSmiTagUint32 : public FixedInputValueNodeT<1, UnsafeSmiTagUint32> {
3772 
3773  public:
3774  explicit UnsafeSmiTagUint32(uint64_t bitfield) : Base(bitfield) {}
3775 
3777  static constexpr
3779 
3780  Input& input() { return Node::input(0); }
3781 
3782 #ifdef V8_COMPRESS_POINTERS
3783  void MarkTaggedInputsAsDecompressing() {
3784  // No tagged inputs.
3785  }
3786 #endif
3787 
3790  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3791 };
3792 
3793 // Input must guarantee to fit in a Smi.
3794 class UnsafeSmiTagIntPtr : public FixedInputValueNodeT<1, UnsafeSmiTagIntPtr> {
3796 
3797  public:
3798  explicit UnsafeSmiTagIntPtr(uint64_t bitfield) : Base(bitfield) {}
3799 
3801  static constexpr
3803 
3804  Input& input() { return Node::input(0); }
3805 
3806 #ifdef V8_COMPRESS_POINTERS
3807  void MarkTaggedInputsAsDecompressing() {
3808  // No tagged inputs.
3809  }
3810 #endif
3811 
3814  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3815 };
3816 
3817 class CheckedSmiUntag : public FixedInputValueNodeT<1, CheckedSmiUntag> {
3819 
3820  public:
3821  explicit CheckedSmiUntag(uint64_t bitfield) : Base(bitfield) {}
3822 
3826  static constexpr
3828 
3829  Input& input() { return Node::input(0); }
3830 
3831 #ifdef V8_COMPRESS_POINTERS
3832  void MarkTaggedInputsAsDecompressing() {
3833  // Don't need to decompress to untag.
3834  }
3835 #endif
3836 
3839  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3840 };
3841 
3842 class UnsafeSmiUntag : public FixedInputValueNodeT<1, UnsafeSmiUntag> {
3844 
3845  public:
3846  explicit UnsafeSmiUntag(uint64_t bitfield) : Base(bitfield) {}
3847 
3848  static constexpr OpProperties kProperties =
3850  static constexpr
3852 
3853  Input& input() { return Node::input(0); }
3854 
3855 #ifdef V8_COMPRESS_POINTERS
3856  void MarkTaggedInputsAsDecompressing() {
3857  // Don't need to decompress to untag.
3858  }
3859 #endif
3860 
3863  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3864 };
3865 
3866 class Int32Constant : public FixedInputValueNodeT<0, Int32Constant> {
3868 
3869  public:
3871 
3872  explicit Int32Constant(uint64_t bitfield, int32_t value)
3873  : Base(bitfield), value_(value) {}
3874 
3876 
3877  int32_t value() const { return value_; }
3878 
3879  bool ToBoolean(LocalIsolate* local_isolate) const { return value_ != 0; }
3880 
3883  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3884 
3887 
3888  private:
3889  const int32_t value_;
3890 };
3891 
3892 class Uint32Constant : public FixedInputValueNodeT<0, Uint32Constant> {
3894 
3895  public:
3897 
3898  explicit Uint32Constant(uint64_t bitfield, uint32_t value)
3899  : Base(bitfield), value_(value) {}
3900 
3902 
3903  uint32_t value() const { return value_; }
3904 
3905  bool ToBoolean(LocalIsolate* local_isolate) const { return value_ != 0; }
3906 
3909  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3910 
3913 
3914  private:
3915  const uint32_t value_;
3916 };
3917 
3918 class IntPtrConstant : public FixedInputValueNodeT<0, IntPtrConstant> {
3920 
3921  public:
3923 
3924  explicit IntPtrConstant(uint64_t bitfield, intptr_t value)
3925  : Base(bitfield), value_(value) {}
3926 
3928 
3929  intptr_t value() const { return value_; }
3930 
3931  bool ToBoolean(LocalIsolate* local_isolate) const { return value_ != 0; }
3932 
3935  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3936 
3939 
3940  private:
3941  const intptr_t value_;
3942 };
3943 
3944 class Float64Constant : public FixedInputValueNodeT<0, Float64Constant> {
3946 
3947  public:
3949 
3950  explicit Float64Constant(uint64_t bitfield, Float64 value)
3951  : Base(bitfield), value_(value) {}
3952 
3954 
3955  Float64 value() const { return value_; }
3956 
3957  bool ToBoolean(LocalIsolate* local_isolate) const {
3958  return value_.get_scalar() != 0.0 && !value_.is_nan();
3959  }
3960 
3963  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
3964 
3967 
3968  private:
3969  const Float64 value_;
3970 };
3971 
3973  : public FixedInputValueNodeT<1, Int32ToUint8Clamped> {
3975 
3976  public:
3977  explicit Int32ToUint8Clamped(uint64_t bitfield) : Base(bitfield) {}
3978 
3980  static constexpr
3982 
3983  Input& input() { return Node::input(0); }
3984 
3987  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
3988 };
3989 
3991  : public FixedInputValueNodeT<1, Uint32ToUint8Clamped> {
3993 
3994  public:
3995  explicit Uint32ToUint8Clamped(uint64_t bitfield) : Base(bitfield) {}
3996 
3998  static constexpr
4000 
4001  Input& input() { return Node::input(0); }
4002 
4005  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4006 };
4007 
4009  : public FixedInputValueNodeT<1, Float64ToUint8Clamped> {
4011 
4012  public:
4013  explicit Float64ToUint8Clamped(uint64_t bitfield) : Base(bitfield) {}
4014 
4016  static constexpr
4018 
4019  Input& input() { return Node::input(0); }
4020 
4023  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4024 };
4025 
4027  : public FixedInputValueNodeT<1, CheckedNumberToUint8Clamped> {
4029 
4030  public:
4031  explicit CheckedNumberToUint8Clamped(uint64_t bitfield) : Base(bitfield) {}
4032 
4033  static constexpr OpProperties kProperties =
4035  static constexpr
4037 
4038  Input& input() { return Node::input(0); }
4039 
4042  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4043 };
4044 
4045 class Int32ToNumber : public FixedInputValueNodeT<1, Int32ToNumber> {
4047 
4048  public:
4049  explicit Int32ToNumber(uint64_t bitfield) : Base(bitfield) {}
4050 
4054  static constexpr
4056 
4057  Input& input() { return Node::input(0); }
4058 
4059  int MaxCallStackArgs() const { return 0; }
4062  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4063 };
4064 
4065 class Uint32ToNumber : public FixedInputValueNodeT<1, Uint32ToNumber> {
4067 
4068  public:
4069  explicit Uint32ToNumber(uint64_t bitfield) : Base(bitfield) {}
4070 
4074  static constexpr
4076 
4077  Input& input() { return Node::input(0); }
4078 
4079  int MaxCallStackArgs() const { return 0; }
4082  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4083 };
4084 
4085 class IntPtrToNumber : public FixedInputValueNodeT<1, IntPtrToNumber> {
4087 
4088  public:
4089  explicit IntPtrToNumber(uint64_t bitfield) : Base(bitfield) {}
4090 
4094  static constexpr
4096 
4097  Input& input() { return Node::input(0); }
4098 
4099  int MaxCallStackArgs() const { return 0; }
4102  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4103 };
4104 
4105 class Float64ToTagged : public FixedInputValueNodeT<1, Float64ToTagged> {
4107 
4108  public:
4110  explicit Float64ToTagged(uint64_t bitfield, ConversionMode mode)
4111  : Base(ConversionModeBitField::update(bitfield, mode)) {}
4112  static constexpr
4114 
4118 
4119  Input& input() { return Node::input(0); }
4120 
4121  int MaxCallStackArgs() const { return 0; }
4124  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4125 
4126  auto options() const { return std::tuple{conversion_mode()}; }
4127 
4129  return ConversionModeBitField::decode(bitfield());
4130  }
4131 
4132  private:
4133  bool canonicalize_smi() {
4134  return ConversionModeBitField::decode(bitfield()) ==
4136  }
4137 
4138  using ConversionModeBitField = NextBitField<ConversionMode, 1>;
4139 };
4140 
4141 // Essentially the same as Float64ToTagged but the result cannot be shared as it
4142 // will be used as a mutable heap number by a store.
4144  : public FixedInputValueNodeT<1, Float64ToHeapNumberForField> {
4146 
4147  public:
4148  explicit Float64ToHeapNumberForField(uint64_t bitfield) : Base(bitfield) {}
4149  static constexpr
4151 
4155 
4156  Input& input() { return Node::input(0); }
4157 
4158  int MaxCallStackArgs() const { return 0; }
4161  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4162 };
4163 
4165  : public FixedInputValueNodeT<1, HoleyFloat64ToTagged> {
4167 
4168  public:
4170  explicit HoleyFloat64ToTagged(uint64_t bitfield, ConversionMode mode)
4171  : Base(ConversionModeBitField::update(bitfield, mode)) {}
4172  static constexpr
4174 
4178 
4179  Input& input() { return Node::input(0); }
4180 
4181  int MaxCallStackArgs() const { return 0; }
4184  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4185 
4187  set_bitfield(ConversionModeBitField::update(bitfield(), mode));
4188  }
4189 
4190  auto options() const { return std::tuple{conversion_mode()}; }
4191 
4193  return ConversionModeBitField::decode(bitfield());
4194  }
4195 
4196  private:
4197  bool canonicalize_smi() {
4198  return ConversionModeBitField::decode(bitfield()) ==
4200  }
4201  using ConversionModeBitField = NextBitField<ConversionMode, 1>;
4202 };
4203 
4205  : public FixedInputValueNodeT<1, CheckedSmiTagFloat64> {
4207 
4208  public:
4209  explicit CheckedSmiTagFloat64(uint64_t bitfield) : Base(bitfield) {}
4210  static constexpr
4212 
4213  static constexpr OpProperties kProperties =
4215 
4216  Input& input() { return Node::input(0); }
4217 
4218  int MaxCallStackArgs() const { return 0; }
4221  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4222 };
4223 
4225  : public FixedInputValueNodeT<1, CheckedInt32ToUint32> {
4227 
4228  public:
4229  explicit CheckedInt32ToUint32(uint64_t bitfield) : Base(bitfield) {}
4230 
4234  static constexpr
4236 
4237  Input& input() { return Node::input(0); }
4238 
4241  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4242 };
4243 
4245  : public FixedInputValueNodeT<1, CheckedIntPtrToUint32> {
4247 
4248  public:
4249  explicit CheckedIntPtrToUint32(uint64_t bitfield) : Base(bitfield) {}
4250 
4254  static constexpr
4256 
4257  Input& input() { return Node::input(0); }
4258 
4261  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4262 };
4263 
4265  : public FixedInputValueNodeT<1, UnsafeInt32ToUint32> {
4267 
4268  public:
4269  explicit UnsafeInt32ToUint32(uint64_t bitfield) : Base(bitfield) {}
4270 
4271  static constexpr OpProperties kProperties =
4273  static constexpr
4275 
4276  Input& input() { return Node::input(0); }
4277 
4280  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4281 };
4282 
4284  : public FixedInputValueNodeT<1, CheckedUint32ToInt32> {
4286 
4287  public:
4288  explicit CheckedUint32ToInt32(uint64_t bitfield) : Base(bitfield) {}
4289 
4293  static constexpr
4295 
4296  Input& input() { return Node::input(0); }
4297 
4300  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4301 };
4302 
4304  : public FixedInputValueNodeT<1, CheckedIntPtrToInt32> {
4306 
4307  public:
4308  explicit CheckedIntPtrToInt32(uint64_t bitfield) : Base(bitfield) {}
4309 
4313  static constexpr
4315 
4316  Input& input() { return Node::input(0); }
4317 
4320  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4321 };
4322 
4324  : public FixedInputValueNodeT<1, ChangeInt32ToFloat64> {
4326 
4327  public:
4328  explicit ChangeInt32ToFloat64(uint64_t bitfield) : Base(bitfield) {}
4329 
4330  static constexpr OpProperties kProperties =
4332  static constexpr
4334 
4335  Input& input() { return Node::input(0); }
4336 
4339  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4340 };
4341 
4343  : public FixedInputValueNodeT<1, ChangeUint32ToFloat64> {
4345 
4346  public:
4347  explicit ChangeUint32ToFloat64(uint64_t bitfield) : Base(bitfield) {}
4348 
4349  static constexpr OpProperties kProperties =
4351  static constexpr
4353 
4354  Input& input() { return Node::input(0); }
4355 
4358  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4359 };
4360 
4362  : public FixedInputValueNodeT<1, ChangeIntPtrToFloat64> {
4364 
4365  public:
4366  explicit ChangeIntPtrToFloat64(uint64_t bitfield) : Base(bitfield) {}
4367 
4368  static constexpr OpProperties kProperties =
4370  static constexpr
4372 
4373  Input& input() { return Node::input(0); }
4374 
4377  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4378 };
4379 
4381  : public FixedInputValueNodeT<1, CheckedTruncateFloat64ToInt32> {
4383 
4384  public:
4385  explicit CheckedTruncateFloat64ToInt32(uint64_t bitfield) : Base(bitfield) {}
4386 
4390  static constexpr
4392 
4393  Input& input() { return Node::input(0); }
4394 
4397  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4398 };
4399 
4401  : public FixedInputValueNodeT<1, Int32AbsWithOverflow> {
4403 
4404  public:
4405  static constexpr OpProperties kProperties =
4407  static constexpr
4409 
4410  static constexpr int kValueIndex = 0;
4412 
4413  explicit Int32AbsWithOverflow(uint64_t bitfield) : Base(bitfield) {}
4414 
4417  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4418 };
4419 
4420 class Float64Abs : public FixedInputValueNodeT<1, Float64Abs> {
4422 
4423  public:
4424  explicit Float64Abs(uint64_t bitfield) : Base(bitfield) {}
4425 
4427  static constexpr
4429 
4430  Input& input() { return Node::input(0); }
4431 
4434  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4435 };
4436 
4438  : public FixedInputValueNodeT<1, Int32CountLeadingZeros> {
4440 
4441  public:
4442  explicit Int32CountLeadingZeros(uint64_t bitfield) : Base(bitfield) {}
4443 
4445  static constexpr
4447 
4448  Input& input() { return Node::input(0); }
4449 
4452  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4453 };
4454 
4456  : public FixedInputValueNodeT<1, SmiCountLeadingZeros> {
4458 
4459  public:
4460  explicit SmiCountLeadingZeros(uint64_t bitfield) : Base(bitfield) {}
4461 
4463 
4464  static constexpr
4466 
4467  Input& input() { return Node::input(0); }
4468 
4471  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4472 };
4473 
4475  : public FixedInputValueNodeT<1, Float64CountLeadingZeros> {
4477 
4478  public:
4479  static Builtin continuation() { return Builtin::kMathClz32Continuation; }
4480 
4481  explicit Float64CountLeadingZeros(uint64_t bitfield) : Base(bitfield) {}
4482 
4483  static constexpr
4486 
4487  Input& input() { return Node::input(0); }
4488 
4491  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4492 };
4493 
4494 class Float64Round : public FixedInputValueNodeT<1, Float64Round> {
4496 
4497  public:
4498  enum class Kind { kFloor, kCeil, kNearest };
4499 
4501  switch (kind) {
4502  case Kind::kCeil:
4503  return Builtin::kMathCeilContinuation;
4504  case Kind::kFloor:
4505  return Builtin::kMathFloorContinuation;
4506  case Kind::kNearest:
4507  return Builtin::kMathRoundContinuation;
4508  }
4509  }
4510 
4511  Float64Round(uint64_t bitfield, Kind kind) : Base(bitfield), kind_(kind) {}
4512 
4514  static constexpr
4516 
4517  Input& input() { return Node::input(0); }
4518  Kind kind() const { return kind_; }
4519 
4522  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4523 
4524  auto options() const { return std::tuple{kind_}; }
4525 
4526  private:
4527  Kind kind_;
4528 };
4529 
4531  : public FixedInputValueNodeT<1, CheckedTruncateFloat64ToUint32> {
4533 
4534  public:
4535  explicit CheckedTruncateFloat64ToUint32(uint64_t bitfield) : Base(bitfield) {}
4536  static constexpr
4538 
4542 
4543  Input& input() { return Node::input(0); }
4544 
4547  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4548 };
4549 
4550 #define DEFINE_TRUNCATE_NODE(name, from_repr, properties) \
4551  class name : public FixedInputValueNodeT<1, name> { \
4552  using Base = FixedInputValueNodeT<1, name>; \
4553  \
4554  public: \
4555  explicit name(uint64_t bitfield) : Base(bitfield) {} \
4556  \
4557  static constexpr OpProperties kProperties = properties; \
4558  static constexpr typename Base::InputTypes kInputTypes{ \
4559  ValueRepresentation::k##from_repr}; \
4560  \
4561  Input& input() { return Node::input(0); } \
4562  \
4563  void SetValueLocationConstraints(); \
4564  void GenerateCode(MaglevAssembler*, const ProcessingState&); \
4565  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
4566  };
4567 
4568 DEFINE_TRUNCATE_NODE(TruncateUint32ToInt32, Uint32, OpProperties::Int32())
4569 DEFINE_TRUNCATE_NODE(TruncateFloat64ToInt32, HoleyFloat64,
4570  OpProperties::Int32())
4571 DEFINE_TRUNCATE_NODE(UnsafeTruncateUint32ToInt32, Uint32, OpProperties::Int32())
4572 DEFINE_TRUNCATE_NODE(UnsafeTruncateFloat64ToInt32, HoleyFloat64,
4573  OpProperties::Int32())
4574 
4575 #undef DEFINE_TRUNCATE_NODE
4576 
4577 template <typename Derived, ValueRepresentation FloatType>
4580 class CheckedNumberOrOddballToFloat64OrHoleyFloat64
4581  : public FixedInputValueNodeT<1, Derived> {
4582  using Base = FixedInputValueNodeT<1, Derived>;
4583  using Base::result;
4584 
4585  public:
4586  explicit CheckedNumberOrOddballToFloat64OrHoleyFloat64(
4587  uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
4588  : Base(TaggedToFloat64ConversionTypeOffset::update(bitfield,
4589  conversion_type)) {}
4590 
4591  static constexpr OpProperties kProperties =
4595  static constexpr
4596  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
4597 
4598  Input& input() { return Node::input(0); }
4599 
4600  TaggedToFloat64ConversionType conversion_type() const {
4601  return TaggedToFloat64ConversionTypeOffset::decode(Base::bitfield());
4602  }
4603 
4604  DeoptimizeReason deoptimize_reason() const {
4605  return conversion_type() == TaggedToFloat64ConversionType::kNumberOrBoolean
4606  ? DeoptimizeReason::kNotANumberOrBoolean
4607  : DeoptimizeReason::kNotANumberOrOddball;
4608  }
4609 
4610  void SetValueLocationConstraints();
4611  void GenerateCode(MaglevAssembler*, const ProcessingState&);
4612  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4613 
4614  auto options() const { return std::tuple{conversion_type()}; }
4615 
4616  private:
4617  using TaggedToFloat64ConversionTypeOffset =
4618  Base::template NextBitField<TaggedToFloat64ConversionType, 2>;
4619 };
4620 
4622  : public CheckedNumberOrOddballToFloat64OrHoleyFloat64<
4623  CheckedNumberOrOddballToFloat64, ValueRepresentation::kFloat64> {
4624  using Base = CheckedNumberOrOddballToFloat64OrHoleyFloat64<
4626 
4627  public:
4629  uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
4630  : Base(bitfield, conversion_type) {}
4631 };
4632 
4634  : public FixedInputValueNodeT<1, CheckedNumberOrOddballToHoleyFloat64> {
4636 
4637  public:
4638  explicit CheckedNumberOrOddballToHoleyFloat64(uint64_t bitfield)
4639  : Base(bitfield) {}
4640 
4644  static constexpr
4646 
4647  Input& input() { return Node::input(0); }
4648 
4650  return DeoptimizeReason::kNotANumberOrOddball;
4651  }
4652 
4655  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4656 };
4657 
4659  : public FixedInputValueNodeT<1, CheckedNumberToInt32> {
4661 
4662  public:
4663  explicit CheckedNumberToInt32(uint64_t bitfield) : Base(bitfield) {}
4664 
4668  static constexpr
4670 
4671  Input& input() { return Node::input(0); }
4672 
4675  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4676 };
4677 
4679  : public FixedInputValueNodeT<1, UncheckedNumberOrOddballToFloat64> {
4681 
4682  public:
4685  : Base(TaggedToFloat64ConversionTypeOffset::update(bitfield,
4686  conversion_type)) {}
4687 
4688  static constexpr OpProperties kProperties =
4690  static constexpr
4692 
4693  Input& input() { return Node::input(0); }
4694 
4697  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4698 
4700  return TaggedToFloat64ConversionTypeOffset::decode(bitfield());
4701  }
4702 
4703  auto options() const { return std::tuple{conversion_type()}; }
4704 
4705  private:
4706  using TaggedToFloat64ConversionTypeOffset =
4707  NextBitField<TaggedToFloat64ConversionType, 2>;
4708 };
4709 
4711  : public FixedInputValueNodeT<1, CheckedHoleyFloat64ToFloat64> {
4713 
4714  public:
4715  explicit CheckedHoleyFloat64ToFloat64(uint64_t bitfield) : Base(bitfield) {}
4716 
4720  static constexpr
4722 
4723  Input& input() { return Node::input(0); }
4724 
4725  int MaxCallStackArgs() const { return 0; }
4728  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4729 };
4730 
4732  : public FixedInputValueNodeT<1, HoleyFloat64ToMaybeNanFloat64> {
4734 
4735  public:
4736  explicit HoleyFloat64ToMaybeNanFloat64(uint64_t bitfield) : Base(bitfield) {}
4737 
4739  static constexpr
4741 
4742  Input& input() { return Node::input(0); }
4743 
4744  int MaxCallStackArgs() const { return 0; }
4747  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4748 };
4749 
4750 #ifdef V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
4751 class Float64ToHoleyFloat64
4752  : public FixedInputValueNodeT<1, Float64ToHoleyFloat64> {
4753  using Base = FixedInputValueNodeT<1, Float64ToHoleyFloat64>;
4754 
4755  public:
4756  explicit Float64ToHoleyFloat64(uint64_t bitfield) : Base(bitfield) {}
4757 
4758  static constexpr OpProperties kProperties =
4760  static constexpr
4761  typename Base::InputTypes kInputTypes{ValueRepresentation::kFloat64};
4762 
4763  Input& input() { return Node::input(0); }
4764 
4765  void SetValueLocationConstraints();
4766  void GenerateCode(MaglevAssembler*, const ProcessingState&);
4767  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4768 };
4769 
4770 class ConvertHoleNanToUndefinedNan
4771  : public FixedInputValueNodeT<1, ConvertHoleNanToUndefinedNan> {
4772  using Base = FixedInputValueNodeT<1, ConvertHoleNanToUndefinedNan>;
4773 
4774  public:
4775  explicit ConvertHoleNanToUndefinedNan(uint64_t bitfield) : Base(bitfield) {}
4776 
4777  static constexpr OpProperties kProperties = OpProperties::HoleyFloat64();
4778  static constexpr
4779  typename Base::InputTypes kInputTypes{ValueRepresentation::kHoleyFloat64};
4780 
4781  Input& input() { return Node::input(0); }
4782 
4783  int MaxCallStackArgs() const { return 0; }
4784  void SetValueLocationConstraints();
4785  void GenerateCode(MaglevAssembler*, const ProcessingState&);
4786  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4787 };
4788 #endif // V8_ENABLE_EXPERIMENTAL_UNDEFINED_DOUBLE
4789 
4790 class HoleyFloat64IsHole : public FixedInputValueNodeT<1, HoleyFloat64IsHole> {
4792 
4793  public:
4794  explicit HoleyFloat64IsHole(uint64_t bitfield) : Base(bitfield) {}
4795 
4796  static constexpr
4798 
4799  Input& input() { return Node::input(0); }
4800 
4803  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4804 };
4805 
4807  : public FixedInputValueNodeT<1, TruncateNumberOrOddballToInt32> {
4809 
4810  public:
4813  : Base(TaggedToFloat64ConversionTypeOffset::update(bitfield,
4814  conversion_type)) {}
4815 
4817  static constexpr
4819 
4820  Input& input() { return Node::input(0); }
4821 
4824  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4825 
4827  return TaggedToFloat64ConversionTypeOffset::decode(bitfield());
4828  }
4829 
4830  auto options() const { return std::tuple{conversion_type()}; }
4831 
4832  private:
4833  using TaggedToFloat64ConversionTypeOffset =
4834  NextBitField<TaggedToFloat64ConversionType, 2>;
4835 };
4836 
4838  : public FixedInputValueNodeT<1, CheckedTruncateNumberOrOddballToInt32> {
4840 
4841  public:
4844  : Base(TaggedToFloat64ConversionTypeOffset::update(bitfield,
4845  conversion_type)) {}
4846 
4847  static constexpr OpProperties kProperties =
4849  static constexpr
4851 
4852  Input& input() { return Node::input(0); }
4853 
4856  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
4857 
4859  return TaggedToFloat64ConversionTypeOffset::decode(bitfield());
4860  }
4861 
4862  auto options() const { return std::tuple{conversion_type()}; }
4863 
4864  private:
4865  using TaggedToFloat64ConversionTypeOffset =
4866  NextBitField<TaggedToFloat64ConversionType, 2>;
4867 };
4868 
4869 class LogicalNot : public FixedInputValueNodeT<1, LogicalNot> {
4871 
4872  public:
4873  explicit LogicalNot(uint64_t bitfield) : Base(bitfield) {}
4874 
4875  static constexpr
4877 
4878  Input& value() { return Node::input(0); }
4879 
4882  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4883 };
4884 
4885 class SetPendingMessage : public FixedInputValueNodeT<1, SetPendingMessage> {
4887 
4888  public:
4889  explicit SetPendingMessage(uint64_t bitfield) : Base(bitfield) {}
4890 
4891  static constexpr OpProperties kProperties =
4893  static constexpr
4895 
4896  Input& value() { return Node::input(0); }
4897 
4900  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4901 };
4902 
4904 class ToBoolean : public FixedInputValueNodeT<1, ToBoolean> {
4906 
4907  public:
4908  explicit ToBoolean(uint64_t bitfield, CheckType check_type)
4909  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
4910 
4911  static constexpr
4913 
4914  Input& value() { return Node::input(0); }
4915  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
4916 
4919  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4920 
4921  auto options() const { return std::tuple{check_type()}; }
4922 
4923  private:
4924  using CheckTypeBitField = NextBitField<CheckType, 1>;
4925 };
4926 
4928  : public FixedInputValueNodeT<1, ToBooleanLogicalNot> {
4930 
4931  public:
4932  explicit ToBooleanLogicalNot(uint64_t bitfield, CheckType check_type)
4933  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
4934 
4935  static constexpr
4937 
4938  Input& value() { return Node::input(0); }
4939  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
4940 
4943  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4944 
4945  auto options() const { return std::tuple{check_type()}; }
4946 
4947  private:
4948  using CheckTypeBitField = NextBitField<CheckType, 1>;
4949 };
4950 
4951 // With StringEqualInputs::kStringsOrOddballs StringEqual allows non-string
4952 // objects which are then compared with pointer equality (they will never be
4953 // equal to a String and they're equal to each other if the pointers are equal).
4955 class StringEqual : public FixedInputValueNodeT<2, StringEqual> {
4957 
4958  public:
4959  explicit StringEqual(uint64_t bitfield, StringEqualInputs inputs)
4960  : Base(bitfield), inputs_(inputs) {}
4964 
4965  static constexpr typename Base::InputTypes kInputTypes{
4967 
4968  Input& lhs() { return Node::input(0); }
4969  Input& rhs() { return Node::input(1); }
4970 
4971  int MaxCallStackArgs() const { return 0; }
4974  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
4975 
4976  StringEqualInputs inputs() const { return inputs_; }
4977  auto options() const { return std::tuple(inputs_); }
4978 
4979  private:
4980  StringEqualInputs inputs_;
4981 };
4982 
4983 class TaggedEqual : public FixedInputValueNodeT<2, TaggedEqual> {
4985 
4986  public:
4987  explicit TaggedEqual(uint64_t bitfield) : Base(bitfield) {}
4988 
4989  static constexpr typename Base::InputTypes kInputTypes{
4991 
4992  Input& lhs() { return Node::input(0); }
4993  Input& rhs() { return Node::input(1); }
4994 
4995 #ifdef V8_COMPRESS_POINTERS
4996  void MarkTaggedInputsAsDecompressing() {
4997  // Don't need to decompress to compare reference equality.
4998  }
4999 #endif
5000 
5003  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5004 };
5005 
5006 class TaggedNotEqual : public FixedInputValueNodeT<2, TaggedNotEqual> {
5008 
5009  public:
5010  explicit TaggedNotEqual(uint64_t bitfield) : Base(bitfield) {}
5011 
5012  static constexpr typename Base::InputTypes kInputTypes{
5014 
5015  Input& lhs() { return Node::input(0); }
5016  Input& rhs() { return Node::input(1); }
5017 
5018 #ifdef V8_COMPRESS_POINTERS
5019  void MarkTaggedInputsAsDecompressing() {
5020  // Don't need to decompress to compare reference equality.
5021  }
5022 #endif
5023 
5026  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5027 };
5028 
5029 class TestInstanceOf : public FixedInputValueNodeT<3, TestInstanceOf> {
5031 
5032  public:
5033  explicit TestInstanceOf(uint64_t bitfield,
5035  : Base(bitfield), feedback_(feedback) {}
5036 
5037  // The implementation currently calls runtime.
5039  static constexpr typename Base::InputTypes kInputTypes{
5042 
5043  Input& context() { return input(0); }
5044  Input& object() { return input(1); }
5045  Input& callable() { return input(2); }
5046  const compiler::FeedbackSource& feedback() const { return feedback_; }
5047 
5048  int MaxCallStackArgs() const;
5051  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5052 
5053  private:
5054  const compiler::FeedbackSource feedback_;
5055 };
5056 
5057 class TestUndetectable : public FixedInputValueNodeT<1, TestUndetectable> {
5059 
5060  public:
5061  explicit TestUndetectable(uint64_t bitfield, CheckType check_type)
5062  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
5063 
5064  static constexpr
5066 
5067  Input& value() { return Node::input(0); }
5068  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
5069 
5072  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5073 
5074  auto options() const { return std::tuple{check_type()}; }
5075 
5076  private:
5077  using CheckTypeBitField = NextBitField<CheckType, 1>;
5078 };
5079 
5080 class TestTypeOf : public FixedInputValueNodeT<1, TestTypeOf> {
5082 
5083  public:
5084  explicit TestTypeOf(uint64_t bitfield,
5086  : Base(bitfield), literal_(literal) {}
5087 
5088  static constexpr
5090 
5091  Input& value() { return Node::input(0); }
5092 
5095  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5096 
5097  auto options() const { return std::tuple{literal_}; }
5098 
5100 
5101  private:
5103 };
5104 
5105 class ToName : public FixedInputValueNodeT<2, ToName> {
5107 
5108  public:
5109  explicit ToName(uint64_t bitfield) : Base(bitfield) {}
5110 
5111  // The implementation currently calls runtime.
5113  static constexpr typename Base::InputTypes kInputTypes{
5115 
5116  Input& context() { return Node::input(0); }
5117  Input& value_input() { return Node::input(1); }
5118 
5119  int MaxCallStackArgs() const;
5122  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5123 };
5124 
5125 class ToNumberOrNumeric : public FixedInputValueNodeT<1, ToNumberOrNumeric> {
5127 
5128  public:
5129  explicit ToNumberOrNumeric(uint64_t bitfield, Object::Conversion mode)
5130  : Base(bitfield), mode_(mode) {}
5131 
5132  static constexpr OpProperties kProperties =
5134  static constexpr
5136 
5137  Input& value_input() { return Node::input(0); }
5138  Object::Conversion mode() const { return mode_; }
5139 
5140  int MaxCallStackArgs() const;
5143  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5144 
5145  private:
5146  const Object::Conversion mode_;
5147 };
5148 
5149 class DeleteProperty : public FixedInputValueNodeT<3, DeleteProperty> {
5151 
5152  public:
5153  explicit DeleteProperty(uint64_t bitfield, LanguageMode mode)
5154  : Base(bitfield), mode_(mode) {}
5155 
5156  // The implementation currently calls runtime.
5158  static constexpr typename Base::InputTypes kInputTypes{
5161 
5162  Input& context() { return Node::input(0); }
5163  Input& object() { return Node::input(1); }
5164  Input& key() { return Node::input(2); }
5165 
5166  LanguageMode mode() const { return mode_; }
5167 
5168  int MaxCallStackArgs() const;
5171  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5172 
5173  private:
5174  const LanguageMode mode_;
5175 };
5176 
5177 class GeneratorStore : public NodeT<GeneratorStore> {
5178  using Base = NodeT<GeneratorStore>;
5179 
5180  public:
5181  // We assume the context as fixed input.
5182  static constexpr int kContextIndex = 0;
5183  static constexpr int kGeneratorIndex = 1;
5184  static constexpr int kFixedInputCount = 2;
5185 
5186  // This ctor is used when for variable input counts.
5187  // Inputs must be initialized manually.
5188  GeneratorStore(uint64_t bitfield, ValueNode* context, ValueNode* generator,
5189  int suspend_id, int bytecode_offset)
5190  : Base(bitfield),
5191  suspend_id_(suspend_id),
5192  bytecode_offset_(bytecode_offset) {
5193  set_input(kContextIndex, context);
5194  set_input(kGeneratorIndex, generator);
5195  }
5196 
5200 
5201  int suspend_id() const { return suspend_id_; }
5202  int bytecode_offset() const { return bytecode_offset_; }
5203 
5204  Input& context_input() { return input(kContextIndex); }
5205  Input& generator_input() { return input(kGeneratorIndex); }
5206 
5208  return input_count() - kFixedInputCount;
5209  }
5212  set_input(i + kFixedInputCount, node);
5213  }
5214 
5215  int MaxCallStackArgs() const;
5216  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
5217 
5218 #ifdef V8_COMPRESS_POINTERS
5219  void MarkTaggedInputsAsDecompressing() {
5220  // Don't need to decompress to store.
5221  }
5222 #endif
5223 
5226  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5227 
5228  private:
5229  const int suspend_id_;
5230  const int bytecode_offset_;
5231 };
5232 
5233 class TryOnStackReplacement : public FixedInputNodeT<1, TryOnStackReplacement> {
5235 
5236  public:
5237  explicit TryOnStackReplacement(uint64_t bitfield, int32_t loop_depth,
5238  FeedbackSlot feedback_slot,
5239  BytecodeOffset osr_offset,
5241  : Base(bitfield),
5242  loop_depth_(loop_depth),
5243  feedback_slot_(feedback_slot),
5244  osr_offset_(osr_offset),
5245  unit_(unit) {}
5246 
5247  static constexpr OpProperties kProperties =
5250  static constexpr
5252 
5253  Input& closure() { return Node::input(0); }
5254 
5255  const MaglevCompilationUnit* unit() const { return unit_; }
5256 
5257  int MaxCallStackArgs() const;
5260  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5261 
5262  private:
5263  // For OSR.
5264  const int32_t loop_depth_;
5265  const FeedbackSlot feedback_slot_;
5266  const BytecodeOffset osr_offset_;
5267  MaglevCompilationUnit* const unit_;
5268 };
5269 
5270 class ForInPrepare : public FixedInputValueNodeT<2, ForInPrepare> {
5272 
5273  public:
5274  explicit ForInPrepare(uint64_t bitfield, compiler::FeedbackSource& feedback)
5275  : Base(bitfield), feedback_(feedback) {}
5276 
5277  static constexpr OpProperties kProperties =
5279  static constexpr typename Base::InputTypes kInputTypes{
5281 
5282  compiler::FeedbackSource feedback() const { return feedback_; }
5283 
5284  Input& context() { return Node::input(0); }
5285  Input& enumerator() { return Node::input(1); }
5286 
5287  int ReturnCount() const { return 2; }
5288 
5289  int MaxCallStackArgs() const;
5292  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5293 
5294  private:
5295  const compiler::FeedbackSource feedback_;
5296 };
5297 
5298 class ForInNext : public FixedInputValueNodeT<5, ForInNext> {
5300 
5301  public:
5302  explicit ForInNext(uint64_t bitfield, compiler::FeedbackSource& feedback)
5303  : Base(bitfield), feedback_(feedback) {}
5304 
5306  static constexpr typename Base::InputTypes kInputTypes{
5310 
5311  compiler::FeedbackSource feedback() const { return feedback_; }
5312 
5313  Input& context() { return Node::input(0); }
5314  Input& receiver() { return Node::input(1); }
5315  Input& cache_array() { return Node::input(2); }
5316  Input& cache_type() { return Node::input(3); }
5317  Input& cache_index() { return Node::input(4); }
5318 
5319  int MaxCallStackArgs() const;
5322  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5323 
5324  private:
5325  const compiler::FeedbackSource feedback_;
5326 };
5327 
5328 class GetIterator : public FixedInputValueNodeT<2, GetIterator> {
5330 
5331  public:
5332  explicit GetIterator(uint64_t bitfield, int load_slot, int call_slot,
5334  : Base(bitfield),
5335  load_slot_(load_slot),
5336  call_slot_(call_slot),
5337  feedback_(feedback.object()) {}
5338 
5340  static constexpr typename Base::InputTypes kInputTypes{
5342 
5343  Input& context() { return input(0); }
5344  Input& receiver() { return input(1); }
5345 
5346  int load_slot() const { return load_slot_; }
5347  int call_slot() const { return call_slot_; }
5348  IndirectHandle<FeedbackVector> feedback() const { return feedback_; }
5349 
5350  int MaxCallStackArgs() const;
5353  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5354 
5355  private:
5356  const int load_slot_;
5357  const int call_slot_;
5358  const IndirectHandle<FeedbackVector> feedback_;
5359 };
5360 
5362  : public FixedInputValueNodeT<0, GetSecondReturnedValue> {
5364 
5365  public:
5366  // TODO(olivf): This is needed because this instruction accesses the raw
5367  // register content. We should have tuple values instead such that we can
5368  // refer to both returned values properly.
5370  explicit GetSecondReturnedValue(uint64_t bitfield) : Base(bitfield) {}
5371 
5374  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5375 };
5376 
5377 class ToObject : public FixedInputValueNodeT<2, ToObject> {
5379 
5380  public:
5381  explicit ToObject(uint64_t bitfield, CheckType check_type)
5382  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
5383 
5384  // The implementation currently calls runtime.
5386  static constexpr typename Base::InputTypes kInputTypes{
5388 
5389  Input& context() { return Node::input(0); }
5390  Input& value_input() { return Node::input(1); }
5391  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
5392 
5393  int MaxCallStackArgs() const;
5396  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5397 
5398  private:
5399  using CheckTypeBitField = NextBitField<CheckType, 1>;
5400 };
5401 
5402 class ToString : public FixedInputValueNodeT<2, ToString> {
5404 
5405  public:
5407  explicit ToString(uint64_t bitfield, ConversionMode mode)
5408  : Base(ConversionModeBitField::update(bitfield, mode)) {}
5409 
5410  // The implementation currently calls runtime.
5412  static constexpr typename Base::InputTypes kInputTypes{
5414 
5415  Input& context() { return Node::input(0); }
5416  Input& value_input() { return Node::input(1); }
5418  return ConversionModeBitField::decode(bitfield());
5419  }
5420 
5421  int MaxCallStackArgs() const;
5424  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5425 
5426  private:
5427  using ConversionModeBitField = NextBitField<ConversionMode, 1>;
5428 };
5429 
5430 class NumberToString : public FixedInputValueNodeT<1, NumberToString> {
5432 
5433  public:
5434  explicit NumberToString(uint64_t bitfield) : Base(bitfield) {}
5435 
5439  static constexpr
5441 
5442  Input& value_input() { return Node::input(0); }
5443 
5444  int MaxCallStackArgs() const { return 0; }
5447  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5448 };
5449 
5451  : public FixedInputValueNodeT<2, GeneratorRestoreRegister> {
5453 
5454  public:
5455  explicit GeneratorRestoreRegister(uint64_t bitfield, int index)
5456  : Base(bitfield), index_(index) {}
5457 
5459  static constexpr typename Base::InputTypes kInputTypes{
5461 
5462  Input& array_input() { return input(0); }
5463  Input& stale_input() { return input(1); }
5464  int index() const { return index_; }
5465 
5468  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5469 
5470  private:
5471  const int index_;
5472 };
5473 
5474 class InitialValue : public FixedInputValueNodeT<0, InitialValue> {
5476 
5477  public:
5478  explicit InitialValue(uint64_t bitfield, interpreter::Register source);
5479 
5480  interpreter::Register source() const { return source_; }
5481  uint32_t stack_slot() const;
5482  static uint32_t stack_slot(uint32_t register_idx);
5483 
5486  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5487 
5488  auto options() const { return std::tuple{source()}; }
5489 
5490  private:
5491  const interpreter::Register source_;
5492 };
5493 
5494 class RegisterInput : public FixedInputValueNodeT<0, RegisterInput> {
5496 
5497  public:
5498  explicit RegisterInput(uint64_t bitfield, Register input)
5499  : Base(bitfield), input_(input) {}
5500 
5501  Register input() const { return input_; }
5502 
5504 
5507  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5508 
5509  private:
5510  const Register input_;
5511 };
5512 
5513 class SmiConstant : public FixedInputValueNodeT<0, SmiConstant> {
5515 
5516  public:
5518 
5519  explicit SmiConstant(uint64_t bitfield, Tagged<Smi> value)
5520  : Base(bitfield), value_(value) {}
5521 
5522  Tagged<Smi> value() const { return value_; }
5523 
5524  bool ToBoolean(LocalIsolate* local_isolate) const {
5525  return value_ != Smi::FromInt(0);
5526  }
5527 
5530  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5531 
5534 
5535  private:
5536  const Tagged<Smi> value_;
5537 };
5538 
5540  : public FixedInputValueNodeT<0, TaggedIndexConstant> {
5542 
5543  public:
5545 
5546  explicit TaggedIndexConstant(uint64_t bitfield, Tagged<TaggedIndex> value)
5547  : Base(bitfield), value_(value) {}
5548 
5549  Tagged<TaggedIndex> value() const { return value_; }
5550 
5551  bool ToBoolean(LocalIsolate* local_isolate) const { UNREACHABLE(); }
5552 
5555  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5556 
5559 
5560  private:
5561  const Tagged<TaggedIndex> value_;
5562 };
5563 
5564 class ExternalConstant : public FixedInputValueNodeT<0, ExternalConstant> {
5566 
5567  public:
5569 
5570  explicit ExternalConstant(uint64_t bitfield,
5572  : Base(bitfield), reference_(reference) {}
5573 
5574  static constexpr OpProperties kProperties =
5576 
5577  ExternalReference reference() const { return reference_; }
5578 
5579  bool ToBoolean(LocalIsolate* local_isolate) const { UNREACHABLE(); }
5580 
5583  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5584 
5587 
5588  private:
5589  const ExternalReference reference_;
5590 };
5591 
5592 class Constant : public FixedInputValueNodeT<0, Constant> {
5594 
5595  public:
5597 
5598  explicit Constant(uint64_t bitfield, compiler::HeapObjectRef object)
5599  : Base(bitfield), object_(object) {}
5600 
5601  bool ToBoolean(LocalIsolate* local_isolate) const {
5602  return Object::BooleanValue(*object_.object(), local_isolate);
5603  }
5604 
5606  return object_.IsTheHole();
5607  }
5608 
5611  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5612 
5613  compiler::HeapObjectRef object() { return object_; }
5614 
5617 
5618  compiler::HeapObjectRef ref() const { return object_; }
5619 
5620  private:
5621  const compiler::HeapObjectRef object_;
5622 };
5623 
5624 class RootConstant : public FixedInputValueNodeT<0, RootConstant> {
5626 
5627  public:
5629 
5630  explicit RootConstant(uint64_t bitfield, RootIndex index)
5631  : Base(bitfield), index_(index) {}
5632 
5633  bool ToBoolean(LocalIsolate* local_isolate) const;
5634 
5635  RootIndex index() const { return index_; }
5636 
5639  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5640 
5643 
5644  private:
5645  const RootIndex index_;
5646 };
5647 
5648 class TrustedConstant : public FixedInputValueNodeT<0, TrustedConstant> {
5650 
5651  public:
5653 
5654  explicit TrustedConstant(uint64_t bitfield, compiler::HeapObjectRef object,
5656  : Base(bitfield), object_(object), tag_(tag) {}
5657 
5659 
5660  bool ToBoolean(LocalIsolate* local_isolate) const { UNREACHABLE(); }
5661 
5664  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5665 
5666  compiler::HeapObjectRef object() const { return object_; }
5667  IndirectPointerTag tag() const { return tag_; }
5668 
5671 
5672  private:
5673  const compiler::HeapObjectRef object_;
5674  const IndirectPointerTag tag_;
5675 };
5676 
5677 class CreateArrayLiteral : public FixedInputValueNodeT<0, CreateArrayLiteral> {
5679 
5680  public:
5681  explicit CreateArrayLiteral(uint64_t bitfield,
5684  int flags)
5685  : Base(bitfield),
5686  constant_elements_(constant_elements),
5687  feedback_(feedback),
5688  flags_(flags) {}
5689 
5690  compiler::HeapObjectRef constant_elements() { return constant_elements_; }
5691  compiler::FeedbackSource feedback() const { return feedback_; }
5692  int flags() const { return flags_; }
5693 
5694  // The implementation currently calls runtime.
5695  static constexpr OpProperties kProperties =
5699 
5700  int MaxCallStackArgs() const;
5703  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5704 
5705  private:
5706  const compiler::HeapObjectRef constant_elements_;
5707  const compiler::FeedbackSource feedback_;
5708  const int flags_;
5709 };
5710 
5712  : public FixedInputValueNodeT<0, CreateShallowArrayLiteral> {
5714 
5715  public:
5716  explicit CreateShallowArrayLiteral(uint64_t bitfield,
5719  int flags)
5720  : Base(bitfield),
5721  constant_elements_(constant_elements),
5722  feedback_(feedback),
5723  flags_(flags) {}
5724 
5725  compiler::HeapObjectRef constant_elements() { return constant_elements_; }
5726  compiler::FeedbackSource feedback() const { return feedback_; }
5727  int flags() const { return flags_; }
5728 
5729  // The implementation currently calls runtime.
5730  static constexpr OpProperties kProperties =
5732 
5733  int MaxCallStackArgs() const;
5736  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5737 
5738  private:
5739  const compiler::HeapObjectRef constant_elements_;
5740  const compiler::FeedbackSource feedback_;
5741  const int flags_;
5742 };
5743 
5745  : public FixedInputValueNodeT<0, CreateObjectLiteral> {
5747 
5748  public:
5750  uint64_t bitfield,
5753  : Base(bitfield),
5754  boilerplate_descriptor_(boilerplate_descriptor),
5755  feedback_(feedback),
5756  flags_(flags) {}
5757 
5759  return boilerplate_descriptor_;
5760  }
5761  compiler::FeedbackSource feedback() const { return feedback_; }
5762  int flags() const { return flags_; }
5763 
5764  // The implementation currently calls runtime.
5765  static constexpr OpProperties kProperties =
5769 
5770  int MaxCallStackArgs() const;
5773  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5774 
5775  private:
5776  const compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor_;
5777  const compiler::FeedbackSource feedback_;
5778  const int flags_;
5779 };
5780 
5782  : public FixedInputValueNodeT<0, CreateShallowObjectLiteral> {
5784 
5785  public:
5787  uint64_t bitfield,
5790  : Base(bitfield),
5791  boilerplate_descriptor_(boilerplate_descriptor),
5792  feedback_(feedback),
5793  flags_(flags) {}
5794 
5795  // TODO(victorgomes): We should not need a boilerplate descriptor in
5796  // CreateShallowObjectLiteral.
5798  return boilerplate_descriptor_;
5799  }
5800  compiler::FeedbackSource feedback() const { return feedback_; }
5801  int flags() const { return flags_; }
5802 
5803  // The implementation currently calls runtime.
5804  static constexpr OpProperties kProperties =
5806 
5807  int MaxCallStackArgs() const;
5810  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
5811 
5812  private:
5813  const compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor_;
5814  const compiler::FeedbackSource feedback_;
5815  const int flags_;
5816 };
5817 
5818 // VirtualObject is a ValueNode only for convenience, it should never be added
5819 // to the Maglev graph.
5820 class VirtualObject : public FixedInputValueNodeT<0, VirtualObject> {
5822 
5823  public:
5824  enum Type : uint8_t {
5829 
5830  kLast = kConsString
5831  };
5832 
5833  friend std::ostream& operator<<(std::ostream& out, Type type) {
5834  switch (type) {
5835  case kDefault:
5836  out << "object";
5837  break;
5838  case kHeapNumber:
5839  out << "number";
5840  break;
5841  case kFixedDoubleArray:
5842  out << "double[]";
5843  break;
5844  case kConsString:
5845  out << "ConsString";
5846  break;
5847  }
5848  return out;
5849  }
5850 
5852  ValueNode* first() const { return data[0]; }
5853  ValueNode* second() const { return data[1]; }
5854  // Length and map are stored for constant folding but not actually part of
5855  // the virtual object as they are not needed to materialize the cons string.
5858  std::array<ValueNode*, 2> data;
5859  };
5860 
5861  explicit VirtualObject(uint64_t bitfield, int id,
5863  : Base(bitfield), id_(id), type_(kConsString), cons_string_(cons_string) {
5864  DCHECK(!has_static_map());
5865  }
5866 
5867  explicit VirtualObject(uint64_t bitfield, compiler::MapRef map, int id,
5868  uint32_t slot_count, ValueNode** slots)
5869  : Base(bitfield),
5870  map_(map),
5871  id_(id),
5872  type_(kDefault),
5873  slots_({slot_count, slots}) {
5875  }
5876 
5877  explicit VirtualObject(uint64_t bitfield, compiler::MapRef map, int id,
5878  Float64 number)
5879  : Base(bitfield),
5880  map_(map),
5881  id_(id),
5882  type_(kHeapNumber),
5883  number_(number) {
5885  }
5886 
5887  explicit VirtualObject(uint64_t bitfield, compiler::MapRef map, int id,
5888  uint32_t length,
5890  : Base(bitfield),
5891  map_(map),
5892  id_(id),
5893  type_(kFixedDoubleArray),
5894  double_array_({length, elements}) {
5896  }
5897 
5900  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
5901 
5902  constexpr bool has_static_map() const {
5903  switch (type_) {
5904  case kDefault:
5905  case kHeapNumber:
5906  case kFixedDoubleArray:
5907  return true;
5908  case kConsString:
5909  return false;
5910  }
5911  }
5912 
5915  return *map_;
5916  }
5917  Type type() const { return type_; }
5918  uint32_t id() const { return id_; }
5919 
5920  size_t size() const {
5921  switch (type_) {
5922  case kDefault:
5923  return (slot_count() + 1) * kTaggedSize;
5924  case kConsString:
5925  return sizeof(ConsString);
5926  case kHeapNumber:
5927  return sizeof(HeapNumber);
5928  case kFixedDoubleArray:
5930  }
5931  }
5932 
5933  Float64 number() const {
5934  DCHECK_EQ(type_, kHeapNumber);
5935  return number_;
5936  }
5937 
5938  uint32_t double_elements_length() const {
5939  DCHECK_EQ(type_, kFixedDoubleArray);
5940  return double_array_.length;
5941  }
5942 
5944  DCHECK_EQ(type_, kFixedDoubleArray);
5945  return double_array_.values;
5946  }
5947 
5948  ValueNode* get(uint32_t offset) const {
5949  DCHECK_NE(offset, 0); // Don't try to get the map through this getter.
5950  DCHECK_EQ(type_, kDefault);
5951  offset -= kTaggedSize;
5953  return slots_.data[offset / kTaggedSize];
5954  }
5955 
5956  void set(uint32_t offset, ValueNode* value) {
5957  DCHECK_NE(offset, 0); // Don't try to set the map through this setter.
5958  DCHECK_EQ(type_, kDefault);
5959  DCHECK(!IsSnapshot());
5960  // Values set here can leak to the interpreter frame state. Conversions
5961  // should be stored in known_node_aspects/NodeInfo.
5962  DCHECK(!value->properties().is_conversion());
5963  offset -= kTaggedSize;
5965  slots_.data[offset / kTaggedSize] = value;
5966  }
5967 
5969  DCHECK_EQ(type_, kConsString);
5970  return cons_string_.length;
5971  }
5972 
5974  DCHECK_EQ(type_, kConsString);
5975  return cons_string_;
5976  }
5977 
5978  void ClearSlots(int last_init_slot, ValueNode* clear_value) {
5979  DCHECK_EQ(type_, kDefault);
5980  int last_init_index = last_init_slot / kTaggedSize;
5981  for (uint32_t i = last_init_index; i < slot_count(); i++) {
5982  slots_.data[i] = clear_value;
5983  }
5984  }
5985 
5986  InlinedAllocation* allocation() const { return allocation_; }
5988  allocation_ = allocation;
5989  }
5990 
5991  bool compatible_for_merge(const VirtualObject* other) const {
5992  if (type_ != other->type_) return false;
5993  if (allocation_ != other->allocation_) return false;
5994  // Currently, the graph builder will never change the VO map.
5995  if (has_static_map()) {
5996  if (map() != other->map()) return false;
5997  }
5998  switch (other->type_) {
5999  case kHeapNumber:
6000  case kFixedDoubleArray:
6001  case kConsString:
6002  return true;
6003  case kDefault:
6004  return slot_count() == other->slot_count();
6005  }
6006  }
6007 
6008  // VOs are snapshotted at branch points and when they are leaked to
6009  // DeoptInfos. This is because the snapshots need to preserve the original
6010  // values at the time of branching or deoptimization. While a VO is not yet
6011  // snapshotted, it can be modified freely.
6012  bool IsSnapshot() const { return snapshotted_; }
6013  void Snapshot() { snapshotted_ = true; }
6014 
6015  template <typename Function>
6016  inline void ForEachInput(Function&& callback) {
6017  switch (type_) {
6018  case kDefault:
6019  for (uint32_t i = 0; i < slot_count(); i++) {
6020  callback(slots_.data[i]);
6021  }
6022  break;
6023  case kConsString:
6024  for (ValueNode*& val : cons_string_.data) {
6025  callback(val);
6026  }
6027  break;
6028  case kHeapNumber:
6029  break;
6030  case kFixedDoubleArray:
6031  break;
6032  }
6033  }
6034 
6035  template <typename Function>
6036  inline void ForEachInput(Function&& callback) const {
6037  switch (type_) {
6038  case kDefault:
6039  for (uint32_t i = 0; i < slot_count(); i++) {
6040  callback(get_by_index(i));
6041  }
6042  break;
6043  case kConsString:
6044  for (ValueNode* val : cons_string_.data) {
6045  callback(val);
6046  }
6047  break;
6048  case kHeapNumber:
6049  break;
6050  case kFixedDoubleArray:
6051  break;
6052  }
6053  }
6054 
6055  // A runtime input is an input to the virtual object that has runtime
6056  // footprint, aka, a location.
6057  template <typename Function>
6058  inline void ForEachNestedRuntimeInput(VirtualObjectList virtual_objects,
6059  Function&& f);
6060  template <typename Function>
6061  inline void ForEachNestedRuntimeInput(VirtualObjectList virtual_objects,
6062  Function&& f) const;
6063 
6064  template <typename Function>
6065  inline std::optional<VirtualObject*> Merge(const VirtualObject* other,
6066  uint32_t new_object_id, Zone* zone,
6067  Function MergeValue) const {
6068  VirtualObject* result = Clone(new_object_id, zone, /* empty_clone */ true);
6069  DCHECK(compatible_for_merge(other));
6070  switch (type_) {
6071  // These objects are immutable and thus should never need merging.
6072  case kHeapNumber:
6073  case kFixedDoubleArray:
6074  case kConsString:
6075  UNREACHABLE();
6076  case kDefault: {
6077  for (uint32_t i = 0; i < slot_count(); i++) {
6078  if (auto success =
6079  MergeValue(get_by_index(i), other->get_by_index(i))) {
6080  result->set_by_index(i, *success);
6081  } else {
6082  return {};
6083  }
6084  }
6085  break;
6086  }
6087  }
6088  return result;
6089  }
6090 
6091  VirtualObject* Clone(uint32_t new_object_id, Zone* zone,
6092  bool empty_clone = false) const {
6094  switch (type_) {
6095  case kHeapNumber:
6096  case kFixedDoubleArray:
6097  case kConsString:
6098  UNREACHABLE();
6099  case kDefault: {
6101  result = NodeBase::New<VirtualObject>(zone, 0, map(), new_object_id,
6102  slot_count(), slots);
6103  break;
6104  }
6105  }
6106  if (empty_clone) return result;
6107 
6108  // Copy content
6109  switch (type_) {
6110  case kHeapNumber:
6111  case kFixedDoubleArray:
6112  case kConsString:
6113  UNREACHABLE();
6114  case kDefault: {
6115  for (uint32_t i = 0; i < slot_count(); i++) {
6116  result->set_by_index(i, get_by_index(i));
6117  }
6118  break;
6119  }
6120  }
6121  result->set_allocation(allocation());
6122  return result;
6123  }
6124 
6125  uint32_t slot_count() const {
6126  DCHECK_EQ(type_, kDefault);
6127  return slots_.count;
6128  }
6129 
6130  private:
6131  ValueNode* get_by_index(uint32_t i) const {
6132  DCHECK_EQ(type_, kDefault);
6133  return slots_.data[i];
6134  }
6135 
6136  void set_by_index(uint32_t i, ValueNode* value) {
6137  DCHECK_EQ(type_, kDefault);
6138  // Values set here can leak to the interpreter. Conversions should be stored
6139  // in known_node_aspects/NodeInfo.
6140  DCHECK(!value->properties().is_conversion());
6141  slots_.data[i] = value;
6142  }
6143 
6144  struct DoubleArray {
6145  uint32_t length;
6146  compiler::FixedDoubleArrayRef values;
6147  };
6148  struct ObjectFields {
6149  uint32_t count; // Does not count the map.
6150  ValueNode** data; // Does not contain the map.
6151  };
6152 
6153  compiler::OptionalMapRef map_;
6154  const int id_;
6155  Type type_; // We need to cache the type. We cannot do map comparison in some
6156  // parts of the pipeline, because we would need to dereference a
6157  // handle.
6158  bool snapshotted_ = false; // Object should not be modified anymore.
6159  union {
6161  DoubleArray double_array_;
6164  };
6165  mutable InlinedAllocation* allocation_ = nullptr;
6166 
6167  VirtualObject* next_ = nullptr;
6168  friend VirtualObjectList;
6169 };
6170 
6172  public:
6174 
6175  class Iterator final {
6176  public:
6177  explicit Iterator(VirtualObject* entry) : entry_(entry) {}
6178 
6180  entry_ = entry_->next_;
6181  return *this;
6182  }
6183  bool operator==(const Iterator& other) const {
6184  return entry_ == other.entry_;
6185  }
6186  bool operator!=(const Iterator& other) const {
6187  return entry_ != other.entry_;
6188  }
6189  VirtualObject*& operator*() { return entry_; }
6190  VirtualObject* operator->() { return entry_; }
6191 
6192  private:
6193  VirtualObject* entry_;
6194  };
6195 
6196  bool operator==(const VirtualObjectList& other) const {
6197  return head_ == other.head_;
6198  }
6199 
6200  void Add(VirtualObject* object) {
6201  DCHECK_NOT_NULL(object);
6202  DCHECK_NULL(object->next_);
6203  object->next_ = head_;
6204  head_ = object;
6205  }
6206 
6207  bool is_empty() const { return head_ == nullptr; }
6208 
6210  VirtualObject* result = nullptr;
6211  for (VirtualObject* vo : *this) {
6212  if (vo->allocation() == allocation) {
6213  result = vo;
6214  break;
6215  }
6216  }
6217  return result;
6218  }
6219 
6220  void Print(std::ostream& os, const char* prefix,
6221  MaglevGraphLabeller* labeller) const;
6222 
6223  // It iterates both list in reverse other of ids until a common point.
6224  template <typename Function>
6226  const VirtualObjectList& list2,
6227  Function&& f) {
6228  VirtualObject* vo1 = list1.head_;
6229  VirtualObject* vo2 = list2.head_;
6230  while (vo1 != nullptr && vo2 != nullptr && vo1 != vo2) {
6231  DCHECK_NE(vo1->id(), vo2->id());
6232  if (vo1->id() > vo2->id()) {
6233  f(vo1, list1);
6234  vo1 = vo1->next_;
6235  } else {
6236  f(vo2, list2);
6237  vo2 = vo2->next_;
6238  }
6239  }
6240  if (vo1 == vo2) return vo1;
6241  return nullptr;
6242  }
6243 
6244  void Snapshot() const {
6245  for (VirtualObject* vo : *this) {
6246  if (vo->IsSnapshot()) {
6247  // Stop processing once a snapshotted object is found, as all remaining
6248  // objects must be snapshotted.
6249  break;
6250  }
6251  vo->Snapshot();
6252  }
6254  }
6255 
6256  bool IsSnapshot() const {
6257  for (VirtualObject* vo : *this) {
6258  if (!vo->IsSnapshot()) return false;
6259  }
6260  return true;
6261  }
6262 
6263  Iterator begin() const { return Iterator(head_); }
6264  Iterator end() const { return Iterator(nullptr); }
6265 
6266  private:
6267  VirtualObject* head_;
6268 };
6269 
6271  kUnknown,
6272  kElided,
6273  kEscaped,
6274 };
6275 
6276 class InlinedAllocation : public FixedInputValueNodeT<1, InlinedAllocation> {
6278 
6279  public:
6281 
6282  explicit InlinedAllocation(uint64_t bitfield, VirtualObject* object)
6283  : Base(bitfield),
6284  object_(object),
6285  escape_analysis_result_(EscapeAnalysisResult::kUnknown) {}
6286 
6287  Input& allocation_block_input() { return input(0); }
6289 
6291  static constexpr
6293 
6296  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6297 
6298  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
6299 
6300  size_t size() const { return object_->size(); }
6301 
6302  VirtualObject* object() const { return object_; }
6303 
6304  int offset() const {
6305  DCHECK_NE(offset_, -1);
6306  return offset_;
6307  }
6308  void set_offset(int offset) { offset_ = offset; }
6309 
6310  int non_escaping_use_count() const { return non_escaping_use_count_; }
6311 
6312  void RemoveNonEscapingUses(int n = 1) {
6313  non_escaping_use_count_ = std::max(non_escaping_use_count_ - n, 0);
6314  }
6315  void AddNonEscapingUses(int n = 1) {
6316  DCHECK(!HasBeenAnalysed());
6317  non_escaping_use_count_ += n;
6318  }
6319  bool IsEscaping() const {
6320  DCHECK(!HasBeenAnalysed());
6321  return use_count_ > non_escaping_use_count_;
6322  }
6323  void ForceEscaping() {
6324  DCHECK(!HasBeenAnalysed());
6325  non_escaping_use_count_ = 0;
6326  }
6327 
6328  void SetElided() {
6329  DCHECK_EQ(escape_analysis_result_, EscapeAnalysisResult::kUnknown);
6330  escape_analysis_result_ = EscapeAnalysisResult::kElided;
6331  }
6332  void SetEscaped() {
6333  // We allow transitions from elided to escaped.
6334  DCHECK_NE(escape_analysis_result_, EscapeAnalysisResult::kEscaped);
6335  escape_analysis_result_ = EscapeAnalysisResult::kEscaped;
6336  }
6337  bool HasBeenElided() const {
6339  DCHECK_GE(use_count_, non_escaping_use_count_);
6340  return escape_analysis_result_ == EscapeAnalysisResult::kElided;
6341  }
6342  bool HasEscaped() const {
6344  return escape_analysis_result_ == EscapeAnalysisResult::kEscaped;
6345  }
6346  bool HasBeenAnalysed() const {
6347  return escape_analysis_result_ != EscapeAnalysisResult::kUnknown;
6348  }
6349 
6350  void UpdateObject(VirtualObject* object) {
6351  DCHECK_EQ(this, object->allocation());
6352  object_ = object;
6353  }
6354 
6355 #ifdef DEBUG
6356  void set_is_returned_value_from_inline_call() {
6357  is_returned_value_from_inline_call_ = true;
6358  }
6359 
6360  bool is_returned_value_from_inline_call() const {
6361  return is_returned_value_from_inline_call_;
6362  }
6363 #endif // DEBUG
6364 
6365  private:
6366  VirtualObject* object_;
6367  EscapeAnalysisResult escape_analysis_result_;
6368  int non_escaping_use_count_ = 0;
6369  int offset_ = -1; // Set by AllocationBlock.
6370 
6371 #ifdef DEBUG
6372  bool is_returned_value_from_inline_call_ = false;
6373 #endif // DEBUG
6374 
6375  InlinedAllocation* next_ = nullptr;
6376  InlinedAllocation** next() { return &next_; }
6377 
6378  friend List;
6379  friend base::ThreadedListTraits<InlinedAllocation>;
6380 };
6381 
6382 template <typename Function>
6384  VirtualObjectList virtual_objects, Function&& f) {
6385  ForEachInput([&](ValueNode*& value) {
6386  if (value->Is<Identity>()) {
6387  value = value->input(0).node();
6388  }
6389  if (IsConstantNode(value->opcode())) {
6390  // No location assigned to constants.
6391  return;
6392  }
6393  // Special nodes.
6394  switch (value->opcode()) {
6395  case Opcode::kArgumentsElements:
6396  case Opcode::kArgumentsLength:
6397  case Opcode::kRestLength:
6398  // No location assigned to these opcodes.
6399  break;
6400  case Opcode::kVirtualObject:
6401  UNREACHABLE();
6402  case Opcode::kInlinedAllocation: {
6403  InlinedAllocation* alloc = value->Cast<InlinedAllocation>();
6404  VirtualObject* inner_vobject = virtual_objects.FindAllocatedWith(alloc);
6405  // Check if it has escaped.
6406  if (inner_vobject &&
6407  (!alloc->HasBeenAnalysed() || alloc->HasBeenElided())) {
6408  inner_vobject->ForEachNestedRuntimeInput(virtual_objects, f);
6409  } else {
6410  f(value);
6411  }
6412  break;
6413  }
6414  default:
6415  f(value);
6416  break;
6417  }
6418  });
6419 }
6420 
6421 template <typename Function>
6422 inline void VirtualObject::ForEachNestedRuntimeInput(
6423  VirtualObjectList virtual_objects, Function&& f) const {
6424  ForEachInput([&](ValueNode* value) {
6425  if (value->Is<Identity>()) {
6426  value = value->input(0).node();
6427  }
6428  if (IsConstantNode(value->opcode())) {
6429  // No location assigned to constants.
6430  return;
6431  }
6432  // Special nodes.
6433  switch (value->opcode()) {
6434  case Opcode::kArgumentsElements:
6435  case Opcode::kArgumentsLength:
6436  case Opcode::kRestLength:
6437  // No location assigned to these opcodes.
6438  break;
6439  case Opcode::kVirtualObject:
6440  UNREACHABLE();
6441  case Opcode::kInlinedAllocation: {
6442  InlinedAllocation* alloc = value->Cast<InlinedAllocation>();
6443  VirtualObject* inner_vobject = virtual_objects.FindAllocatedWith(alloc);
6444  // Check if it has escaped.
6445  if (inner_vobject &&
6446  (!alloc->HasBeenAnalysed() || alloc->HasBeenElided())) {
6447  inner_vobject->ForEachNestedRuntimeInput(virtual_objects, f);
6448  } else {
6449  f(value);
6450  }
6451  break;
6452  }
6453  default:
6454  f(value);
6455  break;
6456  }
6457  });
6458 }
6459 
6460 class AllocationBlock : public FixedInputValueNodeT<0, AllocationBlock> {
6462 
6463  public:
6464  explicit AllocationBlock(uint64_t bitfield, AllocationType allocation_type)
6465  : Base(bitfield), allocation_type_(allocation_type) {}
6466 
6467  static constexpr OpProperties kProperties = OpProperties::CanAllocate() |
6468  OpProperties::DeferredCall() |
6469  OpProperties::NotIdempotent();
6470 
6471  int MaxCallStackArgs() const { return 0; }
6474  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6475 
6476  AllocationType allocation_type() const { return allocation_type_; }
6477  int size() const { return size_; }
6478  void set_size(int size) { size_ = size; }
6479 
6480  InlinedAllocation::List& allocation_list() { return allocation_list_; }
6481 
6482  void Add(InlinedAllocation* alloc) {
6483  allocation_list_.Add(alloc);
6484  size_ += alloc->size();
6485  }
6486 
6487  void TryPretenure(ValueNode* input);
6488 
6490  return elided_write_barriers_depend_on_type_;
6491  }
6493  elided_write_barriers_depend_on_type_ = true;
6494  }
6495 
6496  private:
6497  void TryPretenure();
6498  AllocationType allocation_type_;
6499  int size_ = 0;
6500  bool elided_write_barriers_depend_on_type_ = false;
6501  InlinedAllocation::List allocation_list_;
6502 };
6503 
6504 class ArgumentsLength : public FixedInputValueNodeT<0, ArgumentsLength> {
6506 
6507  public:
6508  explicit ArgumentsLength(uint64_t bitfield) : Base(bitfield) {}
6509 
6510  static constexpr OpProperties kProperties = OpProperties::Int32();
6511 
6512  void SetValueLocationConstraints();
6513  void GenerateCode(MaglevAssembler*, const ProcessingState&);
6514  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6515 };
6516 
6517 class RestLength : public FixedInputValueNodeT<0, RestLength> {
6519 
6520  public:
6521  explicit RestLength(uint64_t bitfield, int formal_parameter_count)
6522  : Base(bitfield), formal_parameter_count_(formal_parameter_count) {}
6523 
6524  void SetValueLocationConstraints();
6525  void GenerateCode(MaglevAssembler*, const ProcessingState&);
6526  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6527 
6528  int formal_parameter_count() const { return formal_parameter_count_; }
6529 
6530  auto options() const { return std::tuple{formal_parameter_count_}; }
6531 
6532  private:
6533  int formal_parameter_count_;
6534 };
6535 
6536 class ArgumentsElements : public FixedInputValueNodeT<1, ArgumentsElements> {
6538 
6539  public:
6540  explicit ArgumentsElements(uint64_t bitfield, CreateArgumentsType type,
6541  int formal_parameter_count)
6542  : Base(bitfield),
6543  type_(type),
6544  formal_parameter_count_(formal_parameter_count) {}
6545 
6546  static constexpr OpProperties kProperties = OpProperties::Call() |
6547  OpProperties::CanAllocate() |
6548  OpProperties::NotIdempotent();
6549 
6550  static constexpr
6551  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
6552 
6553  Input& arguments_count_input() { return input(0); }
6554 
6555  int MaxCallStackArgs() const { return 0; }
6558  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6559 
6560  CreateArgumentsType type() const { return type_; }
6561  int formal_parameter_count() const { return formal_parameter_count_; }
6562 
6563  private:
6565  int formal_parameter_count_;
6566 };
6567 
6568 // TODO(victorgomes): This node is currently not eliminated by the escape
6569 // analysis.
6571  : public FixedInputValueNodeT<1, AllocateElementsArray> {
6573 
6574  public:
6575  explicit AllocateElementsArray(uint64_t bitfield,
6576  AllocationType allocation_type)
6577  : Base(bitfield), allocation_type_(allocation_type) {}
6578 
6579  static constexpr OpProperties kProperties =
6580  OpProperties::CanAllocate() | OpProperties::EagerDeopt() |
6581  OpProperties::DeferredCall() | OpProperties::NotIdempotent();
6582 
6583  Input& length_input() { return input(0); }
6584 
6585  static constexpr
6586  typename Base::InputTypes kInputTypes{ValueRepresentation::kInt32};
6587 
6588  int MaxCallStackArgs() const { return 0; }
6591  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6592 
6593  AllocationType allocation_type() const { return allocation_type_; }
6594 
6595  private:
6596  AllocationType allocation_type_;
6597 };
6598 
6600  : public FixedInputValueNodeT<1, CreateFunctionContext> {
6602 
6603  public:
6604  explicit CreateFunctionContext(uint64_t bitfield,
6605  compiler::ScopeInfoRef scope_info,
6606  uint32_t slot_count, ScopeType scope_type)
6607  : Base(bitfield),
6608  scope_info_(scope_info),
6609  slot_count_(slot_count),
6610  scope_type_(scope_type) {}
6611 
6612  compiler::ScopeInfoRef scope_info() const { return scope_info_; }
6613  uint32_t slot_count() const { return slot_count_; }
6614  ScopeType scope_type() const { return scope_type_; }
6615 
6616  Input& context() { return input(0); }
6617 
6618  // The implementation currently calls runtime.
6619  static constexpr OpProperties kProperties =
6620  OpProperties::Call() | OpProperties::CanAllocate() |
6621  OpProperties::LazyDeopt() | OpProperties::NotIdempotent();
6622  static constexpr
6623  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
6624 
6625  int MaxCallStackArgs() const;
6628  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6629 
6630  private:
6631  const compiler::ScopeInfoRef scope_info_;
6632  const uint32_t slot_count_;
6633  ScopeType scope_type_;
6634 };
6635 
6636 class FastCreateClosure : public FixedInputValueNodeT<1, FastCreateClosure> {
6638 
6639  public:
6641  uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info,
6642  compiler::FeedbackCellRef feedback_cell)
6643  : Base(bitfield),
6644  shared_function_info_(shared_function_info),
6645  feedback_cell_(feedback_cell) {}
6646 
6648  return shared_function_info_;
6649  }
6650  compiler::FeedbackCellRef feedback_cell() const { return feedback_cell_; }
6651 
6652  Input& context() { return input(0); }
6653 
6654  // The implementation currently calls runtime.
6655  static constexpr OpProperties kProperties =
6656  OpProperties::Call() | OpProperties::CanAllocate() |
6657  OpProperties::LazyDeopt() | OpProperties::NotIdempotent();
6658  static constexpr
6659  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
6660 
6661  int MaxCallStackArgs() const;
6664  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6665 
6666  private:
6667  const compiler::SharedFunctionInfoRef shared_function_info_;
6668  const compiler::FeedbackCellRef feedback_cell_;
6669 };
6670 
6672  : public FixedInputValueNodeT<0, CreateRegExpLiteral> {
6674 
6675  public:
6676  explicit CreateRegExpLiteral(uint64_t bitfield, compiler::StringRef pattern,
6677  const compiler::FeedbackSource& feedback,
6678  int flags)
6679  : Base(bitfield), pattern_(pattern), feedback_(feedback), flags_(flags) {}
6680 
6681  compiler::StringRef pattern() { return pattern_; }
6682  compiler::FeedbackSource feedback() const { return feedback_; }
6683  int flags() const { return flags_; }
6684 
6685  // The implementation currently calls runtime.
6686  static constexpr OpProperties kProperties =
6687  OpProperties::Call() | OpProperties::CanAllocate() |
6688  OpProperties::NotIdempotent() | OpProperties::CanThrow();
6689 
6690  int MaxCallStackArgs() const;
6693  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
6694 
6695  private:
6696  compiler::StringRef pattern_;
6697  const compiler::FeedbackSource feedback_;
6698  const int flags_;
6699 };
6700 
6701 class CreateClosure : public FixedInputValueNodeT<1, CreateClosure> {
6703 
6704  public:
6705  explicit CreateClosure(uint64_t bitfield,
6706  compiler::SharedFunctionInfoRef shared_function_info,
6707  compiler::FeedbackCellRef feedback_cell,
6708  bool pretenured)
6709  : Base(bitfield),
6710  shared_function_info_(shared_function_info),
6711  feedback_cell_(feedback_cell),
6712  pretenured_(pretenured) {}
6713 
6715  return shared_function_info_;
6716  }
6717  compiler::FeedbackCellRef feedback_cell() const { return feedback_cell_; }
6718  bool pretenured() const { return pretenured_; }
6719 
6720  Input& context() { return input(0); }
6721 
6722  // The implementation currently calls runtime.
6723  static constexpr OpProperties kProperties = OpProperties::Call() |
6724  OpProperties::CanAllocate() |
6725  OpProperties::NotIdempotent();
6726  static constexpr
6727  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
6728 
6729  int MaxCallStackArgs() const;
6732  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6733 
6734  private:
6735  const compiler::SharedFunctionInfoRef shared_function_info_;
6736  const compiler::FeedbackCellRef feedback_cell_;
6737  const bool pretenured_;
6738 };
6739 
6740 #define ASSERT_CONDITION(V) \
6741  V(Equal) \
6742  V(NotEqual) \
6743  V(LessThan) \
6744  V(LessThanEqual) \
6745  V(GreaterThan) \
6746  V(GreaterThanEqual) \
6747  V(UnsignedLessThan) \
6748  V(UnsignedLessThanEqual) \
6749  V(UnsignedGreaterThan) \
6750  V(UnsignedGreaterThanEqual)
6751 
6752 enum class AssertCondition {
6753 #define D(Name) k##Name,
6754  ASSERT_CONDITION(D)
6755 #undef D
6756 };
6757 static constexpr int kNumAssertConditions =
6758 #define D(Name) +1
6759  0 ASSERT_CONDITION(D);
6760 #undef D
6761 
6762 inline std::ostream& operator<<(std::ostream& os, const AssertCondition cond) {
6763  switch (cond) {
6764 #define CASE(Name) \
6765  case AssertCondition::k##Name: \
6766  os << #Name; \
6767  break;
6769 #undef CASE
6770  }
6771  return os;
6772 }
6773 
6774 class AssertInt32 : public FixedInputNodeT<2, AssertInt32> {
6776 
6777  public:
6778  explicit AssertInt32(uint64_t bitfield, AssertCondition condition,
6779  AbortReason reason)
6780  : Base(bitfield), condition_(condition), reason_(reason) {}
6781 
6782  static constexpr typename Base::InputTypes kInputTypes{
6783  ValueRepresentation::kInt32, ValueRepresentation::kInt32};
6784 
6785  Input& left_input() { return input(0); }
6786  Input& right_input() { return input(1); }
6787 
6790  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6791 
6792  auto options() const { return std::tuple{condition_, reason_}; }
6793 
6794  AssertCondition condition() const { return condition_; }
6795  AbortReason reason() const { return reason_; }
6796 
6797  private:
6798  AssertCondition condition_;
6799  AbortReason reason_;
6800 };
6801 
6802 class CheckMaps : public FixedInputNodeT<1, CheckMaps> {
6804 
6805  public:
6806  explicit CheckMaps(uint64_t bitfield, const compiler::ZoneRefSet<Map>& maps,
6807  CheckType check_type)
6808  : Base(CheckTypeBitField::update(bitfield, check_type)), maps_(maps) {}
6809  explicit CheckMaps(uint64_t bitfield,
6811  CheckType check_type, Zone* zone)
6812  : Base(CheckTypeBitField::update(bitfield, check_type)),
6813  maps_(maps.begin(), maps.end(), zone) {}
6814 
6815  static constexpr OpProperties kProperties =
6816  OpProperties::EagerDeopt() | OpProperties::CanRead();
6817  static constexpr
6818  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
6819 
6820  const compiler::ZoneRefSet<Map>& maps() const { return maps_; }
6821  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6822 
6823  static constexpr int kReceiverIndex = 0;
6824  Input& receiver_input() { return input(kReceiverIndex); }
6825 
6828  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6829 
6830  auto options() const { return std::tuple{maps_, check_type()}; }
6831 
6832  private:
6833  using CheckTypeBitField = NextBitField<CheckType, 1>;
6834  const compiler::ZoneRefSet<Map> maps_;
6835 };
6836 
6838  : public FixedInputNodeT<1, CheckMapsWithMigrationAndDeopt> {
6840 
6841  public:
6842  explicit CheckMapsWithMigrationAndDeopt(uint64_t bitfield,
6843  const compiler::ZoneRefSet<Map>& maps,
6844  CheckType check_type)
6845  : Base(CheckTypeBitField::update(bitfield, check_type)), maps_(maps) {}
6847  uint64_t bitfield, base::Vector<const compiler::MapRef> maps,
6848  CheckType check_type, Zone* zone)
6849  : Base(CheckTypeBitField::update(bitfield, check_type)),
6850  maps_(maps.begin(), maps.end(), zone) {}
6851 
6852  static constexpr OpProperties kProperties =
6853  OpProperties::EagerDeopt() | OpProperties::DeferredCall() |
6854  OpProperties::CanAllocate() | OpProperties::CanWrite() |
6855  OpProperties::CanRead();
6856 
6857  static constexpr
6858  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
6859 
6860  const compiler::ZoneRefSet<Map>& maps() const { return maps_; }
6861  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
6862 
6863  static constexpr int kReceiverIndex = 0;
6864  Input& receiver_input() { return input(kReceiverIndex); }
6865 
6866  int MaxCallStackArgs() const;
6869  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6870 
6871  auto options() const { return std::tuple{maps_, check_type()}; }
6872 
6873  private:
6874  using CheckTypeBitField = NextBitField<CheckType, 1>;
6875  const compiler::ZoneRefSet<Map> maps_;
6876 };
6877 
6879  : public FixedInputNodeT<2, CheckMapsWithAlreadyLoadedMap> {
6881 
6882  public:
6883  explicit CheckMapsWithAlreadyLoadedMap(uint64_t bitfield,
6884  const compiler::ZoneRefSet<Map>& maps)
6885  : Base(bitfield), maps_(maps) {}
6887  uint64_t bitfield, base::Vector<const compiler::MapRef> maps, Zone* zone)
6888  : Base(bitfield), maps_(maps.begin(), maps.end(), zone) {}
6889 
6890  static constexpr OpProperties kProperties =
6891  OpProperties::EagerDeopt() | OpProperties::CanRead();
6892  static constexpr typename Base::InputTypes kInputTypes{
6893  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
6894 
6895  const compiler::ZoneRefSet<Map>& maps() const { return maps_; }
6896 
6897  Input& object_input() { return input(0); }
6898  Input& map_input() { return input(1); }
6899 
6902  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6903 
6904  auto options() const { return std::tuple{maps_}; }
6905 
6906  private:
6907  const compiler::ZoneRefSet<Map> maps_;
6908 };
6909 
6910 class CheckValue : public FixedInputNodeT<1, CheckValue> {
6912 
6913  public:
6914  explicit CheckValue(uint64_t bitfield, const compiler::HeapObjectRef value,
6915  DeoptimizeReason reason)
6916  : Base(bitfield | ReasonField::encode(reason)), value_(value) {}
6917 
6918  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
6919  static constexpr
6920  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
6921 
6922  compiler::HeapObjectRef value() const { return value_; }
6923 
6924  static constexpr int kTargetIndex = 0;
6925  Input& target_input() { return input(kTargetIndex); }
6926 
6927 #ifdef V8_COMPRESS_POINTERS
6928  void MarkTaggedInputsAsDecompressing() {
6929  // Don't need to decompress to compare reference equality.
6930  }
6931 #endif
6932 
6935  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6936 
6937  auto options() const { return std::tuple{value_, deoptimize_reason()}; }
6938 
6940 
6941  private:
6942  const compiler::HeapObjectRef value_;
6943 };
6944 
6945 class CheckValueEqualsInt32 : public FixedInputNodeT<1, CheckValueEqualsInt32> {
6947 
6948  public:
6949  explicit CheckValueEqualsInt32(uint64_t bitfield, int32_t value,
6950  DeoptimizeReason reason)
6951  : Base(bitfield | ReasonField::encode(reason)), value_(value) {}
6952 
6953  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
6954  static constexpr
6955  typename Base::InputTypes kInputTypes{ValueRepresentation::kInt32};
6956 
6957  int32_t value() const { return value_; }
6958 
6959  static constexpr int kTargetIndex = 0;
6960  Input& target_input() { return input(kTargetIndex); }
6961 
6964  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6965 
6966  auto options() const { return std::tuple{value_, deoptimize_reason()}; }
6967 
6969 
6970  private:
6971  const int32_t value_;
6972 };
6973 
6974 class CheckFloat64SameValue : public FixedInputNodeT<1, CheckFloat64SameValue> {
6976 
6977  public:
6978  explicit CheckFloat64SameValue(uint64_t bitfield, Float64 value,
6979  DeoptimizeReason reason)
6980  : Base(bitfield | ReasonField::encode(reason)), value_(value) {}
6981 
6982  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
6983  static constexpr
6984  typename Base::InputTypes kInputTypes{ValueRepresentation::kFloat64};
6985 
6986  Float64 value() const { return value_; }
6987 
6988  static constexpr int kTargetIndex = 0;
6989  Input& target_input() { return input(kTargetIndex); }
6990 
6991  void SetValueLocationConstraints();
6992  void GenerateCode(MaglevAssembler*, const ProcessingState&);
6993  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
6994 
6995  auto options() const { return std::tuple{value_, deoptimize_reason()}; }
6996 
6998 
6999  private:
7000  const Float64 value_;
7001 };
7002 
7004  : public FixedInputNodeT<1, CheckValueEqualsString> {
7006 
7007  public:
7008  explicit CheckValueEqualsString(uint64_t bitfield,
7010  DeoptimizeReason reason)
7011  : Base(bitfield | ReasonField::encode(reason)), value_(value) {}
7012 
7013  // Can allocate if strings are flattened for comparison.
7014  static constexpr OpProperties kProperties = OpProperties::CanAllocate() |
7015  OpProperties::EagerDeopt() |
7016  OpProperties::DeferredCall();
7017  static constexpr
7018  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7019 
7020  compiler::InternalizedStringRef value() const { return value_; }
7021 
7022  static constexpr int kTargetIndex = 0;
7023  Input& target_input() { return input(kTargetIndex); }
7024 
7025  int MaxCallStackArgs() const { return 0; }
7028  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7029 
7030  auto options() const { return std::tuple{value_, deoptimize_reason()}; }
7031 
7033 
7034  private:
7035  const compiler::InternalizedStringRef value_;
7036 };
7037 
7038 class CheckDynamicValue : public FixedInputNodeT<2, CheckDynamicValue> {
7040 
7041  public:
7042  explicit CheckDynamicValue(uint64_t bitfield, DeoptimizeReason reason)
7043  : Base(bitfield | ReasonField::encode(reason)) {}
7044 
7045  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7046  static constexpr typename Base::InputTypes kInputTypes{
7047  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
7048 
7049  static constexpr int kFirstIndex = 0;
7050  static constexpr int kSecondIndex = 1;
7051  Input& first_input() { return input(kFirstIndex); }
7052  Input& second_input() { return input(kSecondIndex); }
7053 
7054 #ifdef V8_COMPRESS_POINTERS
7055  void MarkTaggedInputsAsDecompressing() {
7056  // Don't need to decompress to compare reference equality.
7057  }
7058 #endif
7059 
7062  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7063 
7064  auto options() const { return std::tuple{deoptimize_reason()}; }
7065 
7067 };
7068 
7069 class CheckSmi : public FixedInputNodeT<1, CheckSmi> {
7071 
7072  public:
7073  explicit CheckSmi(uint64_t bitfield) : Base(bitfield) {}
7074 
7075  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7076  static constexpr
7077  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7078 
7079  static constexpr int kReceiverIndex = 0;
7080  Input& receiver_input() { return input(kReceiverIndex); }
7081 
7082  using Node::set_input;
7083 
7084 #ifdef V8_COMPRESS_POINTERS
7085  void MarkTaggedInputsAsDecompressing() {
7086  // Don't need to decompress to check Smi bits.
7087  }
7088 #endif
7089 
7092  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7093 };
7094 
7095 class CheckNumber : public FixedInputNodeT<1, CheckNumber> {
7097 
7098  public:
7099  explicit CheckNumber(uint64_t bitfield, Object::Conversion mode)
7100  : Base(bitfield), mode_(mode) {}
7101 
7102  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7103  static constexpr
7104  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7105 
7106  static constexpr int kReceiverIndex = 0;
7107  Input& receiver_input() { return input(kReceiverIndex); }
7108  Object::Conversion mode() const { return mode_; }
7109 
7112  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7113 
7114  auto options() const { return std::tuple{mode_}; }
7115 
7116  private:
7117  const Object::Conversion mode_;
7118 };
7119 
7120 class CheckHeapObject : public FixedInputNodeT<1, CheckHeapObject> {
7122 
7123  public:
7124  explicit CheckHeapObject(uint64_t bitfield) : Base(bitfield) {}
7125 
7126  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7127  static constexpr
7128  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7129 
7130  static constexpr int kReceiverIndex = 0;
7131  Input& receiver_input() { return input(kReceiverIndex); }
7132 
7133 #ifdef V8_COMPRESS_POINTERS
7134  void MarkTaggedInputsAsDecompressing() {
7135  // Don't need to decompress to check Smi bits.
7136  }
7137 #endif
7138 
7141  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7142 };
7143 
7144 class CheckSymbol : public FixedInputNodeT<1, CheckSymbol> {
7146 
7147  public:
7148  explicit CheckSymbol(uint64_t bitfield, CheckType check_type)
7149  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
7150 
7151  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7152  static constexpr
7153  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7154 
7155  static constexpr int kReceiverIndex = 0;
7156  Input& receiver_input() { return input(kReceiverIndex); }
7157  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7158 
7161  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7162 
7163  auto options() const { return std::tuple{check_type()}; }
7164 
7165  private:
7166  using CheckTypeBitField = NextBitField<CheckType, 1>;
7167 };
7168 
7169 class CheckInstanceType : public FixedInputNodeT<1, CheckInstanceType> {
7171 
7172  public:
7173  explicit CheckInstanceType(uint64_t bitfield, CheckType check_type,
7174  const InstanceType first_instance_type,
7175  const InstanceType last_instance_type)
7176  : Base(CheckTypeBitField::update(bitfield, check_type)),
7177  first_instance_type_(first_instance_type),
7178  last_instance_type_(last_instance_type) {
7179  DCHECK_LE(first_instance_type, last_instance_type);
7180  }
7181 
7182  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7183  static constexpr
7184  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7185 
7186  static constexpr int kReceiverIndex = 0;
7187  Input& receiver_input() { return input(kReceiverIndex); }
7188 
7189  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7190 
7193  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7194 
7195  auto options() const {
7196  return std::tuple{check_type(), first_instance_type_, last_instance_type_};
7197  }
7198 
7199  InstanceType first_instance_type() const { return first_instance_type_; }
7200  InstanceType last_instance_type() const { return last_instance_type_; }
7201 
7202  private:
7203  using CheckTypeBitField = NextBitField<CheckType, 1>;
7204  const InstanceType first_instance_type_;
7205  const InstanceType last_instance_type_;
7206 };
7207 
7208 class CheckString : public FixedInputNodeT<1, CheckString> {
7210 
7211  public:
7212  explicit CheckString(uint64_t bitfield, CheckType check_type)
7213  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
7214 
7215  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7216  static constexpr
7217  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7218 
7219  static constexpr int kReceiverIndex = 0;
7220  Input& receiver_input() { return input(kReceiverIndex); }
7221  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7222 
7225  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7226 
7227  auto options() const { return std::tuple{check_type()}; }
7228 
7229  private:
7230  using CheckTypeBitField = NextBitField<CheckType, 1>;
7231 };
7232 
7233 class CheckSeqOneByteString : public FixedInputNodeT<1, CheckSeqOneByteString> {
7235 
7236  public:
7237  explicit CheckSeqOneByteString(uint64_t bitfield, CheckType check_type)
7238  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
7239 
7240  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7241  static constexpr
7242  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7243 
7244  static constexpr int kReceiverIndex = 0;
7245  Input& receiver_input() { return input(kReceiverIndex); }
7246  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7247 
7250  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7251 
7252  auto options() const { return std::tuple{check_type()}; }
7253 
7254  private:
7255  using CheckTypeBitField = NextBitField<CheckType, 1>;
7256 };
7257 
7259  : public FixedInputNodeT<1, CheckStringOrStringWrapper> {
7261 
7262  public:
7263  explicit CheckStringOrStringWrapper(uint64_t bitfield, CheckType check_type)
7264  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
7265 
7266  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7267  static constexpr
7268  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7269 
7270  static constexpr int kReceiverIndex = 0;
7271  Input& receiver_input() { return input(kReceiverIndex); }
7272  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7273 
7276  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7277 
7278  auto options() const { return std::tuple{check_type()}; }
7279 
7280  private:
7281  using CheckTypeBitField = NextBitField<CheckType, 1>;
7282 };
7283 
7284 class CheckStringOrOddball : public FixedInputNodeT<1, CheckStringOrOddball> {
7286 
7287  public:
7288  explicit CheckStringOrOddball(uint64_t bitfield, CheckType check_type)
7289  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
7290 
7291  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7292  static constexpr
7293  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7294 
7295  static constexpr int kReceiverIndex = 0;
7296  Input& receiver_input() { return input(kReceiverIndex); }
7297  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7298 
7301  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7302 
7303  auto options() const { return std::tuple{check_type()}; }
7304 
7305  private:
7306  using CheckTypeBitField = NextBitField<CheckType, 1>;
7307 };
7308 
7310  : public FixedInputNodeT<1, CheckDetectableCallable> {
7312 
7313  public:
7314  explicit CheckDetectableCallable(uint64_t bitfield, CheckType check_type)
7315  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
7316 
7317  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7318  static constexpr
7319  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7320 
7321  static constexpr int kReceiverIndex = 0;
7322  Input& receiver_input() { return input(kReceiverIndex); }
7323  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7324 
7327  void PrintParams(std::ostream& out, MaglevGraphLabeller*) const {}
7328 
7329  auto options() const { return std::tuple{check_type()}; }
7330 
7331  private:
7332  using CheckTypeBitField = NextBitField<CheckType, 1>;
7333 };
7334 
7336  : public FixedInputNodeT<1, CheckMapsWithMigration> {
7338 
7339  public:
7340  explicit CheckMapsWithMigration(uint64_t bitfield,
7341  const compiler::ZoneRefSet<Map>& maps,
7342  CheckType check_type)
7343  : Base(CheckTypeBitField::update(bitfield, check_type)), maps_(maps) {}
7344 
7345  static constexpr OpProperties kProperties =
7346  OpProperties::EagerDeopt() | OpProperties::DeferredCall() |
7347  OpProperties::CanAllocate() | OpProperties::CanWrite() |
7348  OpProperties::CanRead();
7349  static constexpr
7350  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7351 
7352  const compiler::ZoneRefSet<Map>& maps() const { return maps_; }
7353 
7354  static constexpr int kReceiverIndex = 0;
7355  Input& receiver_input() { return input(kReceiverIndex); }
7356  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7357 
7358  int MaxCallStackArgs() const;
7361  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7362 
7363  void ClearUnstableNodeAspects(KnownNodeAspects& known_node_aspects);
7364 
7365  private:
7366  using CheckTypeBitField = NextBitField<CheckType, 1>;
7367  const compiler::ZoneRefSet<Map> maps_;
7368 };
7369 
7370 class MigrateMapIfNeeded : public FixedInputValueNodeT<2, MigrateMapIfNeeded> {
7372 
7373  public:
7374  explicit MigrateMapIfNeeded(uint64_t bitfield) : Base(bitfield) {}
7375 
7376  static constexpr OpProperties kProperties =
7377  OpProperties::EagerDeopt() | OpProperties::DeferredCall() |
7378  OpProperties::CanAllocate() | OpProperties::CanWrite() |
7379  OpProperties::CanRead();
7380 
7381  static constexpr typename Base::InputTypes kInputTypes{
7382  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
7383 
7384  static constexpr int kMapIndex = 0;
7385  static constexpr int kObjectIndex = 1;
7386 
7387  Input& object_input() { return input(kObjectIndex); }
7388  Input& map_input() { return input(kMapIndex); }
7389 
7390  int MaxCallStackArgs() const;
7393  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7394 
7395  void ClearUnstableNodeAspects(KnownNodeAspects& known_node_aspects);
7396 };
7397 
7399  : public FixedInputNodeT<2, CheckCacheIndicesNotCleared> {
7401 
7402  public:
7403  explicit CheckCacheIndicesNotCleared(uint64_t bitfield) : Base(bitfield) {}
7404  static constexpr OpProperties kProperties =
7405  OpProperties::EagerDeopt() | OpProperties::CanRead();
7406  static constexpr typename Base::InputTypes kInputTypes{
7407  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
7408 
7409  static constexpr int kEnumIndices = 0;
7410  Input& indices_input() { return input(kEnumIndices); }
7411  static constexpr int kCacheLength = 1;
7412  Input& length_input() { return input(kCacheLength); }
7413 
7416  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7417 };
7418 
7419 class CheckJSDataViewBounds : public FixedInputNodeT<2, CheckJSDataViewBounds> {
7421 
7422  public:
7423  explicit CheckJSDataViewBounds(uint64_t bitfield,
7424  ExternalArrayType element_type)
7425  : Base(bitfield), element_type_(element_type) {}
7426 
7427  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7428  static constexpr typename Base::InputTypes kInputTypes{
7429  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
7430 
7431  static constexpr int kReceiverIndex = 0;
7432  static constexpr int kIndexIndex = 1;
7433  Input& receiver_input() { return input(kReceiverIndex); }
7434  Input& index_input() { return input(kIndexIndex); }
7435 
7436  int MaxCallStackArgs() const;
7437  void SetValueLocationConstraints();
7438  void GenerateCode(MaglevAssembler*, const ProcessingState&);
7439  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7440 
7441  auto options() const { return std::tuple{element_type_}; }
7442 
7443  ExternalArrayType element_type() const { return element_type_; }
7444 
7445  private:
7446  ExternalArrayType element_type_;
7447 };
7448 
7450  : public FixedInputValueNodeT<1, LoadTypedArrayLength> {
7452 
7453  public:
7454  explicit LoadTypedArrayLength(uint64_t bitfield, ElementsKind elements_kind)
7455  : Base(bitfield), elements_kind_(elements_kind) {}
7456  static constexpr OpProperties kProperties =
7457  OpProperties::IntPtr() | OpProperties::CanRead();
7458  static constexpr
7459  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7460 
7461  static constexpr int kReceiverIndex = 0;
7462  Input& receiver_input() { return input(kReceiverIndex); }
7463 
7464  void SetValueLocationConstraints();
7465  void GenerateCode(MaglevAssembler*, const ProcessingState&);
7466  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7467 
7468  auto options() const { return std::tuple{elements_kind_}; }
7469 
7470  ElementsKind elements_kind() const { return elements_kind_; }
7471 
7472  private:
7473  ElementsKind elements_kind_;
7474 };
7475 
7477  : public FixedInputNodeT<1, CheckTypedArrayNotDetached> {
7479 
7480  public:
7481  explicit CheckTypedArrayNotDetached(uint64_t bitfield) : Base(bitfield) {}
7482  static constexpr OpProperties kProperties =
7483  OpProperties::EagerDeopt() | OpProperties::CanRead();
7484  static constexpr
7485  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7486 
7487  static constexpr int kObjectIndex = 0;
7488  Input& object_input() { return input(kObjectIndex); }
7489 
7492  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7493 };
7494 
7495 class CheckTypedArrayBounds : public FixedInputNodeT<2, CheckTypedArrayBounds> {
7497 
7498  public:
7499  explicit CheckTypedArrayBounds(uint64_t bitfield) : Base(bitfield) {}
7500  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7501  static constexpr typename Base::InputTypes kInputTypes{
7502  ValueRepresentation::kUint32, ValueRepresentation::kIntPtr};
7503 
7504  static constexpr int kIndexIndex = 0;
7505  static constexpr int kLengthIndex = 1;
7506  Input& index_input() { return input(kIndexIndex); }
7507  Input& length_input() { return input(kLengthIndex); }
7508 
7511  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7512 };
7513 
7514 class CheckInt32Condition : public FixedInputNodeT<2, CheckInt32Condition> {
7516 
7517  public:
7518  explicit CheckInt32Condition(uint64_t bitfield, AssertCondition condition,
7519  DeoptimizeReason reason)
7520  : Base(bitfield | ConditionField::encode(condition) |
7521  ReasonField::encode(reason)) {}
7522 
7523  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
7524  static constexpr typename Base::InputTypes kInputTypes{
7525  ValueRepresentation::kInt32, ValueRepresentation::kInt32};
7526 
7527  static constexpr int kLeftIndex = 0;
7528  static constexpr int kRightIndex = 1;
7529  Input& left_input() { return input(kLeftIndex); }
7530  Input& right_input() { return input(kRightIndex); }
7531 
7533  return ConditionField::decode(bitfield());
7534  }
7535 
7538  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7539 
7540  auto options() const { return std::tuple{condition(), deoptimize_reason()}; }
7541 
7543 
7544  private:
7545  using ConditionField =
7546  ReasonField::Next<AssertCondition, base::bits::WhichPowerOfTwo<size_t>(
7547  base::bits::RoundUpToPowerOfTwo32(
7548  kNumAssertConditions))>;
7549 };
7550 
7551 class DebugBreak : public FixedInputNodeT<0, DebugBreak> {
7553 
7554  public:
7555  explicit DebugBreak(uint64_t bitfield) : Base(bitfield) {}
7556 
7557  static constexpr OpProperties kProperties = OpProperties::NotIdempotent();
7558 
7561  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7562 };
7563 
7564 class Dead : public NodeT<Dead> {
7565  using Base = NodeT<Dead>;
7566 
7567  public:
7570  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7573 
7574  private:
7575  explicit Dead(uint64_t bitfield) : Base(bitfield) {}
7576 };
7577 
7579  : public FixedInputNodeT<0, FunctionEntryStackCheck> {
7581 
7582  public:
7583  explicit FunctionEntryStackCheck(uint64_t bitfield) : Base(bitfield) {}
7584 
7585  // Although FunctionEntryStackCheck calls a builtin, we don't mark it as Call
7586  // here. The register allocator should not spill any live registers, since the
7587  // builtin already handles it. The only possible live register is
7588  // kJavaScriptCallNewTargetRegister.
7589  static constexpr OpProperties kProperties =
7590  OpProperties::LazyDeopt() | OpProperties::CanAllocate() |
7591  OpProperties::DeferredCall() | OpProperties::NotIdempotent();
7592 
7593  int MaxCallStackArgs() const;
7596  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7597 };
7598 
7600  : public FixedInputValueNodeT<1, CheckedInternalizedString> {
7602 
7603  public:
7604  explicit CheckedInternalizedString(uint64_t bitfield, CheckType check_type)
7605  : Base(CheckTypeBitField::update(bitfield, check_type)) {
7606  CHECK_EQ(properties().value_representation(), ValueRepresentation::kTagged);
7607  }
7608 
7609  static constexpr OpProperties kProperties =
7610  OpProperties::EagerDeopt() | OpProperties::TaggedValue();
7611  static constexpr
7612  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7613 
7614  static constexpr int kObjectIndex = 0;
7615  Input& object_input() { return Node::input(kObjectIndex); }
7616  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7617 
7620  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7621 
7622  auto options() const { return std::tuple{check_type()}; }
7623 
7624  private:
7625  using CheckTypeBitField = NextBitField<CheckType, 1>;
7626 };
7627 
7629  : public FixedInputValueNodeT<1, CheckedObjectToIndex> {
7631 
7632  public:
7633  explicit CheckedObjectToIndex(uint64_t bitfield, CheckType check_type)
7634  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
7635 
7636  static constexpr OpProperties kProperties =
7637  OpProperties::EagerDeopt() | OpProperties::Int32() |
7638  OpProperties::DeferredCall() | OpProperties::ConversionNode();
7639  static constexpr
7640  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7641 
7642  static constexpr int kObjectIndex = 0;
7643  Input& object_input() { return Node::input(kObjectIndex); }
7644  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
7645 
7646  int MaxCallStackArgs() const;
7649  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7650 
7651  auto options() const { return std::tuple{check_type()}; }
7652 
7653  private:
7654  using CheckTypeBitField = NextBitField<CheckType, 1>;
7655 };
7656 
7657 class GetTemplateObject : public FixedInputValueNodeT<1, GetTemplateObject> {
7659 
7660  public:
7662  uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info,
7663  const compiler::FeedbackSource& feedback)
7664  : Base(bitfield),
7665  shared_function_info_(shared_function_info),
7666  feedback_(feedback) {}
7667 
7668  // The implementation currently calls runtime.
7669  static constexpr OpProperties kProperties =
7670  OpProperties::GenericRuntimeOrBuiltinCall();
7671  static constexpr
7672  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7673 
7674  Input& description() { return input(0); }
7675 
7677  return shared_function_info_;
7678  }
7679  compiler::FeedbackSource feedback() const { return feedback_; }
7680 
7681  int MaxCallStackArgs() const;
7684  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7685 
7686  private:
7687  compiler::SharedFunctionInfoRef shared_function_info_;
7688  const compiler::FeedbackSource feedback_;
7689 };
7690 
7692  : public FixedInputValueNodeT<1, HasInPrototypeChain> {
7694 
7695  public:
7696  explicit HasInPrototypeChain(uint64_t bitfield,
7698  : Base(bitfield), prototype_(prototype) {}
7699 
7700  // The implementation can enter user code in the deferred call (due to
7701  // proxied getPrototypeOf).
7702  static constexpr OpProperties kProperties =
7703  OpProperties::DeferredCall() | OpProperties::CanCallUserCode();
7704  static constexpr
7705  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
7706 
7707  Input& object() { return input(0); }
7708 
7709  compiler::HeapObjectRef prototype() { return prototype_; }
7710 
7711  int MaxCallStackArgs() const;
7714  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7715 
7716  private:
7717  compiler::HeapObjectRef prototype_;
7718 };
7719 
7721  : public FixedInputValueNodeT<1, BuiltinStringFromCharCode> {
7723 
7724  public:
7725  explicit BuiltinStringFromCharCode(uint64_t bitfield) : Base(bitfield) {}
7726 
7727  static constexpr OpProperties kProperties =
7728  OpProperties::CanAllocate() | OpProperties::DeferredCall();
7729  static constexpr
7730  typename Base::InputTypes kInputTypes{ValueRepresentation::kInt32};
7731 
7732  Input& code_input() { return input(0); }
7733 
7734  int MaxCallStackArgs() const;
7735  void SetValueLocationConstraints();
7736  void GenerateCode(MaglevAssembler*, const ProcessingState&);
7737  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7738 };
7739 
7741  : public FixedInputValueNodeT<2,
7742  BuiltinStringPrototypeCharCodeOrCodePointAt> {
7743  using Base =
7745 
7746  public:
7747  enum Mode {
7750  };
7751 
7753  Mode mode)
7754  : Base(bitfield | ModeField::encode(mode)) {}
7755 
7756  static constexpr OpProperties kProperties =
7757  OpProperties::CanAllocate() | OpProperties::CanRead() |
7758  OpProperties::DeferredCall() | OpProperties::Int32();
7759  static constexpr typename Base::InputTypes kInputTypes{
7760  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
7761 
7762  static constexpr int kStringIndex = 0;
7763  static constexpr int kIndexIndex = 1;
7764  Input& string_input() { return input(kStringIndex); }
7765  Input& index_input() { return input(kIndexIndex); }
7766 
7767  int MaxCallStackArgs() const;
7770  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
7771 
7772  auto options() const { return std::tuple{mode()}; }
7773 
7774  Mode mode() const { return ModeField::decode(bitfield()); }
7775 
7776  private:
7777  using ModeField = NextBitField<Mode, 1>;
7778 };
7779 
7781  : public FixedInputValueNodeT<2, BuiltinSeqOneByteStringCharCodeAt> {
7783 
7784  public:
7785  explicit BuiltinSeqOneByteStringCharCodeAt(uint64_t bitfield)
7786  : Base(bitfield) {}
7787 
7788  static constexpr OpProperties kProperties =
7789  OpProperties::CanRead() | OpProperties::Int32();
7790  static constexpr typename Base::InputTypes kInputTypes{
7791  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
7792 
7793  static constexpr int kStringIndex = 0;
7794  static constexpr int kIndexIndex = 1;
7795  Input& string_input() { return input(kStringIndex); }
7796  Input& index_input() { return input(kIndexIndex); }
7797 
7800  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7801 };
7802 
7803 class MapPrototypeGet : public FixedInputValueNodeT<2, MapPrototypeGet> {
7805 
7806  public:
7807  explicit MapPrototypeGet(uint64_t bitfield) : Base(bitfield) {}
7808 
7809  static constexpr OpProperties kProperties =
7810  OpProperties::Call() | OpProperties::CanAllocate() |
7811  OpProperties::CanRead() | OpProperties::TaggedValue();
7812  static constexpr typename Base::InputTypes kInputTypes{
7813  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
7814 
7815  Input& table_input() { return input(0); }
7816  Input& key_input() { return input(1); }
7817 
7818  int MaxCallStackArgs() const {
7819  // Only implemented in Turbolev.
7820  UNREACHABLE();
7821  }
7822 
7825  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7826 };
7827 
7829  : public FixedInputValueNodeT<2, MapPrototypeGetInt32Key> {
7831 
7832  public:
7833  explicit MapPrototypeGetInt32Key(uint64_t bitfield) : Base(bitfield) {}
7834 
7835  static constexpr OpProperties kProperties = OpProperties::CanAllocate() |
7836  OpProperties::CanRead() |
7837  OpProperties::TaggedValue();
7838  static constexpr typename Base::InputTypes kInputTypes{
7839  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
7840 
7841  Input& table_input() { return input(0); }
7842  Input& key_input() { return input(1); }
7843 
7846  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7847 };
7848 
7849 class SetPrototypeHas : public FixedInputValueNodeT<2, SetPrototypeHas> {
7851 
7852  public:
7853  explicit SetPrototypeHas(uint64_t bitfield) : Base(bitfield) {}
7854 
7855  // CanAllocate is needed, since finding strings in hash tables does an
7856  // equality comparison which flattens strings.
7857  static constexpr OpProperties kProperties =
7858  OpProperties::Call() | OpProperties::CanAllocate() |
7859  OpProperties::CanRead() | OpProperties::TaggedValue();
7860  static constexpr typename Base::InputTypes kInputTypes{
7861  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
7862 
7863  Input& table_input() { return input(0); }
7864  Input& key_input() { return input(1); }
7865 
7866  int MaxCallStackArgs() const {
7867  // Only implemented in Turbolev.
7868  UNREACHABLE();
7869  }
7870 
7873  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7874 };
7875 
7877  : public FixedInputValueNodeT<1, CreateFastArrayElements> {
7879 
7880  public:
7881  explicit CreateFastArrayElements(uint64_t bitfield,
7882  AllocationType allocation_type)
7883  : Base(bitfield), allocation_type_(allocation_type) {}
7884 
7885  AllocationType allocation_type() const { return allocation_type_; }
7886 
7887  static constexpr OpProperties kProperties =
7888  OpProperties::CanAllocate() | OpProperties::NotIdempotent();
7889 
7890  static constexpr
7891  typename Base::InputTypes kInputTypes{ValueRepresentation::kInt32};
7892 
7893  Input& length_input() { return input(0); }
7894 
7897  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7898 
7899  private:
7900  const AllocationType allocation_type_;
7901 };
7902 
7904  : public FixedInputValueNodeT<3, TransitionAndStoreArrayElement> {
7906 
7907  public:
7908  explicit TransitionAndStoreArrayElement(uint64_t bitfield,
7909  const compiler::MapRef& fast_map,
7910  const compiler::MapRef& double_map)
7911  : Base(bitfield), fast_map_(fast_map), double_map_(double_map) {}
7912 
7913  static constexpr OpProperties kProperties =
7914  OpProperties::AnySideEffects() | OpProperties::DeferredCall();
7915  static constexpr typename Base::InputTypes kInputTypes{
7916  ValueRepresentation::kTagged, ValueRepresentation::kInt32,
7917  ValueRepresentation::kTagged};
7918 
7919  Input& array_input() { return input(0); }
7920  Input& index_input() { return input(1); }
7921  Input& value_input() { return input(2); }
7922 
7923  compiler::MapRef fast_map() const { return fast_map_; }
7924  compiler::MapRef double_map() const { return double_map_; }
7925 
7926  int MaxCallStackArgs() const {
7927  // Only implemented in Turbolev.
7928  UNREACHABLE();
7929  }
7932 
7933  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
7934 
7935  private:
7936  const compiler::MapRef fast_map_;
7937  const compiler::MapRef double_map_;
7938 };
7939 
7941  public:
7942  enum Kind {
7949  };
7950 
7952  const ZoneVector<compiler::MapRef>& maps) {
7954  }
7956  const ZoneVector<compiler::MapRef>& maps, compiler::ObjectRef constant) {
7957  return PolymorphicAccessInfo(kConstant, maps, Representation::Tagged(),
7958  constant);
7959  }
7961  const ZoneVector<compiler::MapRef>& maps, Float64 constant) {
7962  return PolymorphicAccessInfo(kConstantDouble, maps, constant);
7963  }
7965  const ZoneVector<compiler::MapRef>& maps, Representation representation,
7966  compiler::OptionalJSObjectRef holder, FieldIndex field_index) {
7967  return PolymorphicAccessInfo(kDataLoad, maps, representation, holder,
7968  field_index);
7969  }
7971  const ZoneVector<compiler::MapRef>& maps, compiler::CellRef cell) {
7972  return PolymorphicAccessInfo(kModuleExport, maps, Representation::Tagged(),
7973  cell);
7974  }
7976  const ZoneVector<compiler::MapRef>& maps) {
7977  return PolymorphicAccessInfo(kStringLength, maps, Representation::Smi());
7978  }
7979 
7980  Kind kind() const { return kind_; }
7981 
7982  const ZoneVector<compiler::MapRef>& maps() const { return maps_; }
7983 
7985  DCHECK_EQ(kind_, kConstant);
7986  return constant_.object();
7987  }
7988 
7989  double constant_double() const {
7990  DCHECK_EQ(kind_, kConstantDouble);
7991  return constant_double_.get_scalar();
7992  }
7993 
7995  DCHECK_EQ(kind_, kModuleExport);
7996  return constant_.AsCell().object();
7997  }
7998 
7999  compiler::OptionalJSObjectRef holder() const {
8000  DCHECK_EQ(kind_, kDataLoad);
8001  return data_load_.holder_;
8002  }
8003 
8005  DCHECK_EQ(kind_, kDataLoad);
8006  return data_load_.field_index_;
8007  }
8008 
8009  Representation field_representation() const { return representation_; }
8010 
8011  bool operator==(const PolymorphicAccessInfo& other) const {
8012  if (kind_ != other.kind_ || !(representation_ == other.representation_)) {
8013  return false;
8014  }
8015  if (maps_.size() != other.maps_.size()) {
8016  return false;
8017  }
8018  for (size_t i = 0; i < maps_.size(); ++i) {
8019  if (maps_[i] != other.maps_[i]) {
8020  return false;
8021  }
8022  }
8023  switch (kind_) {
8024  case kNotFound:
8025  case kStringLength:
8026  return true;
8027  case kModuleExport:
8028  case kConstant:
8029  return constant_.equals(other.constant_);
8030  case kConstantDouble:
8031  return constant_double_ == other.constant_double_;
8032  case kDataLoad:
8033  return data_load_.holder_.equals(other.data_load_.holder_) &&
8034  data_load_.field_index_ == other.data_load_.field_index_;
8035  }
8036  }
8037 
8038  size_t hash_value() const {
8039  size_t hash = base::hash_value(kind_);
8040  hash = base::hash_combine(hash, base::hash_value(representation_.kind()));
8041  for (auto map : maps()) {
8042  hash = base::hash_combine(hash, map.hash_value());
8043  }
8044  switch (kind_) {
8045  case kNotFound:
8046  case kStringLength:
8047  break;
8048  case kModuleExport:
8049  case kConstant:
8050  hash = base::hash_combine(hash, constant_.hash_value());
8051  break;
8052  case kConstantDouble:
8053  hash = base::hash_combine(hash, base::hash_value(constant_double_));
8054  break;
8055  case kDataLoad:
8056  hash = base::hash_combine(
8057  hash, base::hash_value(data_load_.holder_.hash_value()));
8058  hash = base::hash_combine(
8059  hash, base::hash_value(data_load_.field_index_.index()));
8060  break;
8061  }
8062  return hash;
8063  }
8064 
8065  private:
8066  explicit PolymorphicAccessInfo(Kind kind,
8067  const ZoneVector<compiler::MapRef>& maps,
8068  Representation representation)
8069  : kind_(kind), maps_(maps), representation_(representation) {
8070  DCHECK(kind == kNotFound || kind == kStringLength);
8071  }
8072 
8073  PolymorphicAccessInfo(Kind kind, const ZoneVector<compiler::MapRef>& maps,
8074  Representation representation,
8075  compiler::ObjectRef constant)
8076  : kind_(kind),
8077  maps_(maps),
8078  representation_(representation),
8079  constant_(constant) {
8080  DCHECK(kind == kConstant || kind == kModuleExport);
8081  }
8082 
8083  PolymorphicAccessInfo(Kind kind, const ZoneVector<compiler::MapRef>& maps,
8084  Float64 constant)
8085  : kind_(kind),
8086  maps_(maps),
8087  representation_(Representation::Double()),
8088  constant_double_(constant) {
8089  DCHECK_EQ(kind, kConstantDouble);
8090  }
8091 
8092  PolymorphicAccessInfo(Kind kind, const ZoneVector<compiler::MapRef>& maps,
8093  Representation representation,
8094  compiler::OptionalJSObjectRef holder,
8095  FieldIndex field_index)
8096  : kind_(kind),
8097  maps_(maps),
8098  representation_(representation),
8099  data_load_{holder, field_index} {
8100  DCHECK_EQ(kind, kDataLoad);
8101  }
8102 
8103  const Kind kind_;
8104  // TODO(victorgomes): Create a PolymorphicMapChecks and avoid the maps here.
8105  const ZoneVector<compiler::MapRef> maps_;
8106  const Representation representation_;
8107  union {
8108  const compiler::ObjectRef constant_;
8110  struct {
8111  const compiler::OptionalJSObjectRef holder_;
8113  } data_load_;
8114  };
8115 };
8116 
8117 template <typename Derived = LoadTaggedField>
8118 class AbstractLoadTaggedField : public FixedInputValueNodeT<1, Derived> {
8120  using Base::result;
8121 
8122  public:
8123  explicit AbstractLoadTaggedField(uint64_t bitfield, const int offset)
8124  : Base(bitfield), offset_(offset) {}
8125 
8126  static constexpr OpProperties kProperties = OpProperties::CanRead();
8127  static constexpr
8128  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
8129 
8130  int offset() const { return offset_; }
8131 
8132  using Base::input;
8133  static constexpr int kObjectIndex = 0;
8134  Input& object_input() { return input(kObjectIndex); }
8135 
8138  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8139 
8140  auto options() const { return std::tuple{offset()}; }
8141 
8142  using Base::decompresses_tagged_result;
8143 
8144  private:
8145  const int offset_;
8146 };
8147 
8148 class LoadTaggedField : public AbstractLoadTaggedField<LoadTaggedField> {
8150 
8151  public:
8152  explicit LoadTaggedField(uint64_t bitfield, const int offset)
8153  : Base(bitfield, offset) {}
8154 };
8155 
8157  : public AbstractLoadTaggedField<LoadTaggedFieldForProperty> {
8159 
8160  public:
8161  explicit LoadTaggedFieldForProperty(uint64_t bitfield, const int offset,
8163  : Base(bitfield, offset), name_(name) {}
8164  compiler::NameRef name() { return name_; }
8165 
8166  auto options() const { return std::tuple{offset(), name_}; }
8167 
8168  private:
8169  compiler::NameRef name_;
8170 };
8171 
8173  : public AbstractLoadTaggedField<LoadTaggedFieldForContextSlotNoCells> {
8175 
8176  public:
8177  explicit LoadTaggedFieldForContextSlotNoCells(uint64_t bitfield,
8178  const int offset)
8179  : Base(bitfield, offset) {}
8180 };
8181 
8183  : public FixedInputValueNodeT<1, LoadTaggedFieldForContextSlot> {
8185 
8186  public:
8187  explicit LoadTaggedFieldForContextSlot(uint64_t bitfield, const int offset)
8188  : Base(bitfield), offset_(offset) {}
8189 
8190  static constexpr OpProperties kProperties = OpProperties::CanRead() |
8191  OpProperties::CanAllocate() |
8192  OpProperties::DeferredCall();
8193  static constexpr
8194  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
8195 
8196  int offset() const { return offset_; }
8197 
8198  using Base::input;
8199  static constexpr int kContextIndex = 0;
8200  Input& context() { return input(kContextIndex); }
8201 
8202  int MaxCallStackArgs() const { return 0; }
8205  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8206 
8207  auto options() const { return std::tuple{offset()}; }
8208 
8209  using Base::decompresses_tagged_result;
8210 
8211  private:
8212  const int offset_;
8213 };
8214 
8215 class LoadDoubleField : public FixedInputValueNodeT<1, LoadDoubleField> {
8217 
8218  public:
8219  explicit LoadDoubleField(uint64_t bitfield, int offset)
8220  : Base(bitfield), offset_(offset) {}
8221 
8222  static constexpr OpProperties kProperties =
8223  OpProperties::CanRead() | OpProperties::Float64();
8224  static constexpr
8225  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
8226 
8227  int offset() const { return offset_; }
8228 
8229  static constexpr int kObjectIndex = 0;
8230  Input& object_input() { return input(kObjectIndex); }
8231 
8234  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8235 
8236  auto options() const { return std::tuple{offset()}; }
8237 
8238  private:
8239  const int offset_;
8240 };
8241 
8242 class LoadFloat64 : public FixedInputValueNodeT<1, LoadFloat64> {
8244 
8245  public:
8246  explicit LoadFloat64(uint64_t bitfield, int offset)
8247  : Base(bitfield), offset_(offset) {}
8248 
8249  static constexpr OpProperties kProperties =
8250  OpProperties::CanRead() | OpProperties::Float64();
8251  static constexpr
8252  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
8253 
8254  int offset() const { return offset_; }
8255 
8256  static constexpr int kObjectIndex = 0;
8257  Input& object_input() { return input(kObjectIndex); }
8258 
8261  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8262 
8263  auto options() const { return std::tuple{offset()}; }
8264 
8265  private:
8266  const int offset_;
8267 };
8268 
8269 class LoadInt32 : public FixedInputValueNodeT<1, LoadInt32> {
8271 
8272  public:
8273  explicit LoadInt32(uint64_t bitfield, int offset)
8274  : Base(bitfield), offset_(offset) {}
8275 
8276  static constexpr OpProperties kProperties =
8277  OpProperties::CanRead() | OpProperties::Int32();
8278  static constexpr
8279  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
8280 
8281  int offset() const { return offset_; }
8282 
8283  static constexpr int kObjectIndex = 0;
8284  Input& object_input() { return input(kObjectIndex); }
8285 
8288  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8289 
8290  auto options() const { return std::tuple{offset()}; }
8291 
8292  private:
8293  const int offset_;
8294 };
8295 
8297  : public FixedInputValueNodeT<2, LoadTaggedFieldByFieldIndex> {
8299 
8300  public:
8301  explicit LoadTaggedFieldByFieldIndex(uint64_t bitfield) : Base(bitfield) {}
8302 
8303  static constexpr OpProperties kProperties = OpProperties::CanAllocate() |
8304  OpProperties::CanRead() |
8305  OpProperties::DeferredCall();
8306  static constexpr typename Base::InputTypes kInputTypes{
8307  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
8308 
8309  static constexpr int kObjectIndex = 0;
8310  static constexpr int kIndexIndex = 1;
8311  Input& object_input() { return input(kObjectIndex); }
8312  Input& index_input() { return input(kIndexIndex); }
8313 
8314 #ifdef V8_COMPRESS_POINTERS
8315  void MarkTaggedInputsAsDecompressing() {
8316  // Only need to decompress the object, the index should be a Smi.
8317  object_input().node()->SetTaggedResultNeedsDecompress();
8318  }
8319 #endif
8320 
8321  int MaxCallStackArgs() const { return 0; }
8324  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8325 };
8326 
8328  : public FixedInputValueNodeT<2, LoadFixedArrayElement> {
8330 
8331  public:
8332  explicit LoadFixedArrayElement(uint64_t bitfield) : Base(bitfield) {}
8333 
8334  static constexpr OpProperties kProperties = OpProperties::CanRead();
8335  static constexpr typename Base::InputTypes kInputTypes{
8336  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
8337 
8338  static constexpr int kElementsIndex = 0;
8339  static constexpr int kIndexIndex = 1;
8340  Input& elements_input() { return input(kElementsIndex); }
8341  Input& index_input() { return input(kIndexIndex); }
8342 
8345  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8346 };
8347 
8349  : public FixedInputValueNodeT<2, EnsureWritableFastElements> {
8351 
8352  public:
8353  explicit EnsureWritableFastElements(uint64_t bitfield) : Base(bitfield) {}
8354 
8355  static constexpr OpProperties kProperties = OpProperties::CanAllocate() |
8356  OpProperties::DeferredCall() |
8357  OpProperties::CanWrite();
8358  static constexpr typename Base::InputTypes kInputTypes{
8359  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
8360 
8361  static constexpr int kElementsIndex = 0;
8362  static constexpr int kObjectIndex = 1;
8363  Input& elements_input() { return input(kElementsIndex); }
8364  Input& object_input() { return input(kObjectIndex); }
8365 
8366  int MaxCallStackArgs() const { return 0; }
8369  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8370 };
8371 
8373  : public FixedInputValueNodeT<2, ExtendPropertiesBackingStore> {
8375 
8376  public:
8377  explicit ExtendPropertiesBackingStore(uint64_t bitfield, int old_length)
8378  : Base(bitfield), old_length_(old_length) {}
8379 
8380  static constexpr OpProperties kProperties =
8381  OpProperties::CanAllocate() | OpProperties::CanRead() |
8382  OpProperties::CanWrite() | OpProperties::DeferredCall() |
8383  OpProperties::EagerDeopt() | OpProperties::NotIdempotent();
8384 
8385  static constexpr typename Base::InputTypes kInputTypes{
8386  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
8387 
8388  static constexpr int kPropertyArrayIndex = 0;
8389  static constexpr int kObjectIndex = 1;
8390  Input& property_array_input() { return input(kPropertyArrayIndex); }
8391  Input& object_input() { return input(kObjectIndex); }
8392 
8393  int MaxCallStackArgs() const { return 0; }
8396  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8397 
8398  int old_length() const { return old_length_; }
8399 
8400  private:
8401  const int old_length_;
8402 };
8403 
8405  : public FixedInputValueNodeT<4, MaybeGrowFastElements> {
8407 
8408  public:
8409  explicit MaybeGrowFastElements(uint64_t bitfield, ElementsKind elements_kind)
8410  : Base(bitfield), elements_kind_(elements_kind) {}
8411 
8412  static constexpr OpProperties kProperties =
8413  OpProperties::CanAllocate() | OpProperties::DeferredCall() |
8414  OpProperties::CanWrite() | OpProperties::EagerDeopt();
8415  static constexpr typename Base::InputTypes kInputTypes{
8416  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
8417  ValueRepresentation::kInt32, ValueRepresentation::kInt32};
8418 
8419  static constexpr int kElementsIndex = 0;
8420  static constexpr int kObjectIndex = 1;
8421  static constexpr int kIndexIndex = 2;
8422  static constexpr int kElementsLengthIndex = 3;
8423  Input& elements_input() { return input(kElementsIndex); }
8424  Input& object_input() { return input(kObjectIndex); }
8425  Input& index_input() { return input(kIndexIndex); }
8426  Input& elements_length_input() { return input(kElementsLengthIndex); }
8427 
8428  ElementsKind elements_kind() const { return elements_kind_; }
8429 
8430  int MaxCallStackArgs() const { return 0; }
8433  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8434 
8435  auto options() const { return std::tuple{elements_kind()}; }
8436 
8437  private:
8438  const ElementsKind elements_kind_;
8439 };
8440 
8442  : public FixedInputNodeT<3, StoreFixedArrayElementWithWriteBarrier> {
8444 
8445  public:
8446  explicit StoreFixedArrayElementWithWriteBarrier(uint64_t bitfield)
8447  : Base(bitfield) {}
8448 
8449  static constexpr OpProperties kProperties =
8450  OpProperties::CanWrite() | OpProperties::DeferredCall();
8451  static constexpr typename Base::InputTypes kInputTypes{
8452  ValueRepresentation::kTagged, ValueRepresentation::kInt32,
8453  ValueRepresentation::kTagged};
8454 
8455  static constexpr int kElementsIndex = 0;
8456  static constexpr int kIndexIndex = 1;
8457  static constexpr int kValueIndex = 2;
8458  Input& elements_input() { return input(kElementsIndex); }
8459  Input& index_input() { return input(kIndexIndex); }
8460  Input& value_input() { return input(kValueIndex); }
8461 
8462  int MaxCallStackArgs() const { return 0; }
8465  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8466 };
8467 
8468 // StoreFixedArrayElementNoWriteBarrier never does a Deferred Call. However,
8469 // PhiRepresentationSelector can cause some StoreFixedArrayElementNoWriteBarrier
8470 // to become StoreFixedArrayElementWithWriteBarrier, which can do Deferred
8471 // Calls, and thus need the register snapshot. We thus set the DeferredCall
8472 // property in StoreFixedArrayElementNoWriteBarrier so that it's allocated with
8473 // enough space for the register snapshot.
8475  : public FixedInputNodeT<3, StoreFixedArrayElementNoWriteBarrier> {
8477 
8478  public:
8479  explicit StoreFixedArrayElementNoWriteBarrier(uint64_t bitfield)
8480  : Base(bitfield) {}
8481 
8482  static constexpr OpProperties kProperties =
8483  OpProperties::CanWrite() | OpProperties::DeferredCall();
8484  static constexpr typename Base::InputTypes kInputTypes{
8485  ValueRepresentation::kTagged, ValueRepresentation::kInt32,
8486  ValueRepresentation::kTagged};
8487 
8488  static constexpr int kElementsIndex = 0;
8489  static constexpr int kIndexIndex = 1;
8490  static constexpr int kValueIndex = 2;
8491  Input& elements_input() { return input(kElementsIndex); }
8492  Input& index_input() { return input(kIndexIndex); }
8493  Input& value_input() { return input(kValueIndex); }
8494 
8495  int MaxCallStackArgs() const {
8496  // StoreFixedArrayElementNoWriteBarrier never really does any call.
8497  return 0;
8498  }
8501  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8502 };
8503 
8505  : public FixedInputValueNodeT<2, LoadFixedDoubleArrayElement> {
8507 
8508  public:
8509  explicit LoadFixedDoubleArrayElement(uint64_t bitfield) : Base(bitfield) {}
8510 
8511  static constexpr OpProperties kProperties =
8512  OpProperties::CanRead() | OpProperties::Float64();
8513  static constexpr typename Base::InputTypes kInputTypes{
8514  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
8515 
8516  static constexpr int kElementsIndex = 0;
8517  static constexpr int kIndexIndex = 1;
8518  Input& elements_input() { return input(kElementsIndex); }
8519  Input& index_input() { return input(kIndexIndex); }
8520 
8523  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8524 };
8525 
8527  : public FixedInputValueNodeT<2, LoadHoleyFixedDoubleArrayElement> {
8529 
8530  public:
8531  explicit LoadHoleyFixedDoubleArrayElement(uint64_t bitfield)
8532  : Base(bitfield) {}
8533 
8534  static constexpr OpProperties kProperties =
8535  OpProperties::CanRead() | OpProperties::HoleyFloat64();
8536  static constexpr typename Base::InputTypes kInputTypes{
8537  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
8538 
8539  static constexpr int kElementsIndex = 0;
8540  static constexpr int kIndexIndex = 1;
8541  Input& elements_input() { return input(kElementsIndex); }
8542  Input& index_input() { return input(kIndexIndex); }
8543 
8546  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8547 };
8548 
8550  : public FixedInputValueNodeT<
8551  2, LoadHoleyFixedDoubleArrayElementCheckedNotHole> {
8552  using Base =
8554 
8555  public:
8557  : Base(bitfield) {}
8558 
8559  static constexpr OpProperties kProperties = OpProperties::CanRead() |
8561  OpProperties::EagerDeopt();
8562  static constexpr typename Base::InputTypes kInputTypes{
8563  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
8564 
8565  static constexpr int kElementsIndex = 0;
8566  static constexpr int kIndexIndex = 1;
8567  Input& elements_input() { return input(kElementsIndex); }
8568  Input& index_input() { return input(kIndexIndex); }
8569 
8572  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8573 };
8574 
8576  : public FixedInputNodeT<3, StoreFixedDoubleArrayElement> {
8578 
8579  public:
8580  explicit StoreFixedDoubleArrayElement(uint64_t bitfield) : Base(bitfield) {}
8581 
8582  static constexpr OpProperties kProperties = OpProperties::CanWrite();
8583  static constexpr typename Base::InputTypes kInputTypes{
8584  ValueRepresentation::kTagged, ValueRepresentation::kInt32,
8585  ValueRepresentation::kHoleyFloat64};
8586 
8587  static constexpr int kElementsIndex = 0;
8588  static constexpr int kIndexIndex = 1;
8589  static constexpr int kValueIndex = 2;
8590  Input& elements_input() { return input(kElementsIndex); }
8591  Input& index_input() { return input(kIndexIndex); }
8592  Input& value_input() { return input(kValueIndex); }
8593 
8596  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8597 };
8598 
8600  : public FixedInputValueNodeT<3, LoadSignedIntDataViewElement> {
8602 
8603  public:
8604  explicit LoadSignedIntDataViewElement(uint64_t bitfield,
8606  : Base(bitfield), type_(type) {
8610  }
8611 
8612  static constexpr OpProperties kProperties =
8613  OpProperties::CanRead() | OpProperties::Int32();
8614  static constexpr typename Base::InputTypes kInputTypes{
8615  ValueRepresentation::kTagged, ValueRepresentation::kInt32,
8616  ValueRepresentation::kTagged};
8617 
8618  static constexpr int kObjectIndex = 0;
8619  static constexpr int kIndexIndex = 1;
8620  static constexpr int kIsLittleEndianIndex = 2;
8621  Input& object_input() { return input(kObjectIndex); }
8622  Input& index_input() { return input(kIndexIndex); }
8623  Input& is_little_endian_input() { return input(kIsLittleEndianIndex); }
8624 
8626  return IsConstantNode(is_little_endian_input().node()->opcode());
8627  }
8628 
8631  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8632 
8633  auto options() const { return std::tuple{type_}; }
8634 
8635  ExternalArrayType type() const { return type_; }
8636 
8637  private:
8639 };
8640 
8642  : public FixedInputValueNodeT<3, LoadDoubleDataViewElement> {
8644  static constexpr ExternalArrayType type_ =
8646 
8647  public:
8648  explicit LoadDoubleDataViewElement(uint64_t bitfield, ExternalArrayType type)
8649  : Base(bitfield) {
8650  DCHECK_EQ(type, type_);
8651  }
8652 
8653  static constexpr OpProperties kProperties =
8654  OpProperties::CanRead() | OpProperties::Float64();
8655  static constexpr typename Base::InputTypes kInputTypes{
8656  ValueRepresentation::kTagged, ValueRepresentation::kInt32,
8657  ValueRepresentation::kTagged};
8658 
8659  static constexpr int kObjectIndex = 0;
8660  static constexpr int kIndexIndex = 1;
8661  static constexpr int kIsLittleEndianIndex = 2;
8662  Input& object_input() { return input(kObjectIndex); }
8663  Input& index_input() { return input(kIndexIndex); }
8664  Input& is_little_endian_input() { return input(kIsLittleEndianIndex); }
8665 
8667  return IsConstantNode(is_little_endian_input().node()->opcode());
8668  }
8669 
8672  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8673 
8674  auto options() const { return std::tuple{type_}; }
8675 };
8676 
8677 #define LOAD_TYPED_ARRAY(name, properties, ...) \
8678  class name : public FixedInputValueNodeT<2, name> { \
8679  using Base = FixedInputValueNodeT<2, name>; \
8680  \
8681  public: \
8682  explicit name(uint64_t bitfield, ElementsKind elements_kind) \
8683  : Base(bitfield), elements_kind_(elements_kind) { \
8684  DCHECK(elements_kind == \
8685  v8::internal::compiler::turboshaft::any_of(__VA_ARGS__)); \
8686  } \
8687  \
8688  static constexpr OpProperties kProperties = \
8689  OpProperties::CanRead() | properties; \
8690  static constexpr typename Base::InputTypes kInputTypes{ \
8691  ValueRepresentation::kTagged, ValueRepresentation::kUint32}; \
8692  \
8693  static constexpr int kObjectIndex = 0; \
8694  static constexpr int kIndexIndex = 1; \
8695  Input& object_input() { return input(kObjectIndex); } \
8696  Input& index_input() { return input(kIndexIndex); } \
8697  \
8698  void SetValueLocationConstraints(); \
8699  void GenerateCode(MaglevAssembler*, const ProcessingState&); \
8700  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
8701  \
8702  auto options() const { return std::tuple{elements_kind_}; } \
8703  \
8704  ElementsKind elements_kind() const { return elements_kind_; } \
8705  \
8706  private: \
8707  ElementsKind elements_kind_; \
8708  };
8709 
8710 LOAD_TYPED_ARRAY(LoadSignedIntTypedArrayElement, OpProperties::Int32(),
8711  INT8_ELEMENTS, INT16_ELEMENTS, INT32_ELEMENTS)
8712 
8713 LOAD_TYPED_ARRAY(LoadUnsignedIntTypedArrayElement, OpProperties::Uint32(),
8715  UINT16_ELEMENTS, UINT32_ELEMENTS)
8716 
8717 LOAD_TYPED_ARRAY(LoadDoubleTypedArrayElement, OpProperties::Float64(),
8718  FLOAT32_ELEMENTS, FLOAT64_ELEMENTS)
8719 
8720 #undef LOAD_TYPED_ARRAY
8721 
8722 #define LOAD_CONSTANT_TYPED_ARRAY(name, properties, ...) \
8723  class name : public FixedInputValueNodeT<1, name> { \
8724  using Base = FixedInputValueNodeT<1, name>; \
8725  \
8726  public: \
8727  explicit name(uint64_t bitfield, compiler::JSTypedArrayRef typed_array, \
8728  ElementsKind elements_kind) \
8729  : Base(bitfield), \
8730  typed_array_(typed_array), \
8731  elements_kind_(elements_kind) { \
8732  DCHECK(elements_kind == \
8733  v8::internal::compiler::turboshaft::any_of(__VA_ARGS__)); \
8734  } \
8735  \
8736  static constexpr OpProperties kProperties = \
8737  OpProperties::CanRead() | properties; \
8738  static constexpr \
8739  typename Base::InputTypes kInputTypes{ValueRepresentation::kUint32}; \
8740  \
8741  static constexpr int kIndexIndex = 0; \
8742  Input& index_input() { return input(kIndexIndex); } \
8743  \
8744  void SetValueLocationConstraints(); \
8745  void GenerateCode(MaglevAssembler*, const ProcessingState&); \
8746  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
8747  \
8748  auto options() const { return std::tuple{typed_array_, elements_kind_}; } \
8749  \
8750  ElementsKind elements_kind() const { return elements_kind_; } \
8751  compiler::JSTypedArrayRef typed_array() const { return typed_array_; } \
8752  \
8753  private: \
8754  compiler::JSTypedArrayRef typed_array_; \
8755  ElementsKind elements_kind_; \
8756  };
8757 
8758 LOAD_CONSTANT_TYPED_ARRAY(LoadSignedIntConstantTypedArrayElement,
8759  OpProperties::Int32(), INT8_ELEMENTS, INT16_ELEMENTS,
8760  INT32_ELEMENTS)
8761 
8762 LOAD_CONSTANT_TYPED_ARRAY(LoadUnsignedIntConstantTypedArrayElement,
8765  UINT16_ELEMENTS, UINT32_ELEMENTS)
8766 
8767 LOAD_CONSTANT_TYPED_ARRAY(LoadDoubleConstantTypedArrayElement,
8769  FLOAT64_ELEMENTS)
8770 
8771 #undef LOAD_CONSTANT_TYPED_ARRAY
8772 
8773 #define STORE_TYPED_ARRAY(name, properties, type, ...) \
8774  class name : public FixedInputNodeT<3, name> { \
8775  using Base = FixedInputNodeT<3, name>; \
8776  \
8777  public: \
8778  explicit name(uint64_t bitfield, ElementsKind elements_kind) \
8779  : Base(bitfield), elements_kind_(elements_kind) { \
8780  DCHECK(elements_kind == \
8781  v8::internal::compiler::turboshaft::any_of(__VA_ARGS__)); \
8782  } \
8783  \
8784  static constexpr OpProperties kProperties = properties; \
8785  static constexpr typename Base::InputTypes kInputTypes{ \
8786  ValueRepresentation::kTagged, ValueRepresentation::kUint32, type}; \
8787  \
8788  static constexpr int kObjectIndex = 0; \
8789  static constexpr int kIndexIndex = 1; \
8790  static constexpr int kValueIndex = 2; \
8791  Input& object_input() { return input(kObjectIndex); } \
8792  Input& index_input() { return input(kIndexIndex); } \
8793  Input& value_input() { return input(kValueIndex); } \
8794  \
8795  void SetValueLocationConstraints(); \
8796  void GenerateCode(MaglevAssembler*, const ProcessingState&); \
8797  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
8798  \
8799  ElementsKind elements_kind() const { return elements_kind_; } \
8800  \
8801  private: \
8802  ElementsKind elements_kind_; \
8803  };
8804 
8805 STORE_TYPED_ARRAY(StoreIntTypedArrayElement, OpProperties::CanWrite(),
8806  ValueRepresentation::kInt32, INT8_ELEMENTS, INT16_ELEMENTS,
8807  INT32_ELEMENTS, UINT8_ELEMENTS, UINT8_CLAMPED_ELEMENTS,
8808  UINT16_ELEMENTS, UINT16_ELEMENTS, UINT32_ELEMENTS)
8809 STORE_TYPED_ARRAY(StoreDoubleTypedArrayElement, OpProperties::CanWrite(),
8810  ValueRepresentation::kHoleyFloat64, FLOAT32_ELEMENTS,
8811  FLOAT64_ELEMENTS)
8812 #undef STORE_TYPED_ARRAY
8813 
8814 #define STORE_CONSTANT_TYPED_ARRAY(name, properties, type, ...) \
8815  class name : public FixedInputNodeT<2, name> { \
8816  using Base = FixedInputNodeT<2, name>; \
8817  \
8818  public: \
8819  explicit name(uint64_t bitfield, compiler::JSTypedArrayRef typed_array, \
8820  ElementsKind elements_kind) \
8821  : Base(bitfield), \
8822  typed_array_(typed_array), \
8823  elements_kind_(elements_kind) { \
8824  DCHECK(elements_kind == \
8825  v8::internal::compiler::turboshaft::any_of(__VA_ARGS__)); \
8826  } \
8827  \
8828  static constexpr OpProperties kProperties = properties; \
8829  static constexpr typename Base::InputTypes kInputTypes{ \
8830  ValueRepresentation::kUint32, type}; \
8831  \
8832  static constexpr int kIndexIndex = 0; \
8833  static constexpr int kValueIndex = 1; \
8834  Input& index_input() { return input(kIndexIndex); } \
8835  Input& value_input() { return input(kValueIndex); } \
8836  \
8837  void SetValueLocationConstraints(); \
8838  void GenerateCode(MaglevAssembler*, const ProcessingState&); \
8839  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {} \
8840  \
8841  ElementsKind elements_kind() const { return elements_kind_; } \
8842  compiler::JSTypedArrayRef typed_array() const { return typed_array_; } \
8843  \
8844  private: \
8845  compiler::JSTypedArrayRef typed_array_; \
8846  ElementsKind elements_kind_; \
8847  };
8848 
8849 STORE_CONSTANT_TYPED_ARRAY(StoreIntConstantTypedArrayElement,
8850  OpProperties::CanWrite(),
8851  ValueRepresentation::kInt32, INT8_ELEMENTS,
8852  INT16_ELEMENTS, INT32_ELEMENTS, UINT8_ELEMENTS,
8854  UINT16_ELEMENTS, UINT32_ELEMENTS)
8855 STORE_CONSTANT_TYPED_ARRAY(StoreDoubleConstantTypedArrayElement,
8856  OpProperties::CanWrite(),
8857  ValueRepresentation::kHoleyFloat64, FLOAT32_ELEMENTS,
8858  FLOAT64_ELEMENTS)
8859 #undef STORE_CONSTANT_TYPED_ARRAY
8860 
8862  : public FixedInputNodeT<4, StoreSignedIntDataViewElement> {
8864 
8865  public:
8866  explicit StoreSignedIntDataViewElement(uint64_t bitfield,
8868  : Base(bitfield), type_(type) {
8872  }
8873 
8874  static constexpr OpProperties kProperties = OpProperties::CanWrite();
8875  static constexpr typename Base::InputTypes kInputTypes{
8876  ValueRepresentation::kTagged, ValueRepresentation::kInt32,
8877  ValueRepresentation::kInt32, ValueRepresentation::kTagged};
8878 
8879  static constexpr int kObjectIndex = 0;
8880  static constexpr int kIndexIndex = 1;
8881  static constexpr int kValueIndex = 2;
8882  static constexpr int kIsLittleEndianIndex = 3;
8883  Input& object_input() { return input(kObjectIndex); }
8884  Input& index_input() { return input(kIndexIndex); }
8885  Input& value_input() { return input(kValueIndex); }
8886  Input& is_little_endian_input() { return input(kIsLittleEndianIndex); }
8887 
8889  return IsConstantNode(is_little_endian_input().node()->opcode());
8890  }
8891 
8894  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8895 
8896  ExternalArrayType type() const { return type_; }
8897 
8898  private:
8900 };
8901 
8903  : public FixedInputNodeT<4, StoreDoubleDataViewElement> {
8905 
8906  public:
8908  : Base(bitfield) {
8910  }
8911 
8912  static constexpr OpProperties kProperties = OpProperties::CanWrite();
8913  static constexpr typename Base::InputTypes kInputTypes{
8914  ValueRepresentation::kTagged, ValueRepresentation::kInt32,
8915  ValueRepresentation::kHoleyFloat64, ValueRepresentation::kTagged};
8916 
8917  static constexpr int kObjectIndex = 0;
8918  static constexpr int kIndexIndex = 1;
8919  static constexpr int kValueIndex = 2;
8920  static constexpr int kIsLittleEndianIndex = 3;
8921  Input& object_input() { return input(kObjectIndex); }
8922  Input& index_input() { return input(kIndexIndex); }
8923  Input& value_input() { return input(kValueIndex); }
8924  Input& is_little_endian_input() { return input(kIsLittleEndianIndex); }
8925 
8927  return IsConstantNode(is_little_endian_input().node()->opcode());
8928  }
8929 
8932  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
8933 };
8934 
8935 class StoreDoubleField : public FixedInputNodeT<2, StoreDoubleField> {
8937 
8938  public:
8939  explicit StoreDoubleField(uint64_t bitfield, int offset)
8940  : Base(bitfield), offset_(offset) {}
8941 
8942  static constexpr OpProperties kProperties = OpProperties::CanWrite();
8943  static constexpr typename Base::InputTypes kInputTypes{
8944  ValueRepresentation::kTagged, ValueRepresentation::kFloat64};
8945 
8946  int offset() const { return offset_; }
8947 
8948  static constexpr int kObjectIndex = 0;
8949  static constexpr int kValueIndex = 1;
8950  Input& object_input() { return input(kObjectIndex); }
8951  Input& value_input() { return input(kValueIndex); }
8952 
8955  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8956 
8957  private:
8958  const int offset_;
8959 };
8960 
8961 class StoreInt32 : public FixedInputNodeT<2, StoreInt32> {
8963 
8964  public:
8965  explicit StoreInt32(uint64_t bitfield, int offset)
8966  : Base(bitfield), offset_(offset) {}
8967 
8968  static constexpr OpProperties kProperties = OpProperties::CanWrite();
8969  static constexpr typename Base::InputTypes kInputTypes{
8970  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
8971 
8972  int offset() const { return offset_; }
8973 
8974  static constexpr int kObjectIndex = 0;
8975  static constexpr int kValueIndex = 1;
8976  Input& object_input() { return input(kObjectIndex); }
8977  Input& value_input() { return input(kValueIndex); }
8978 
8981  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
8982 
8983  private:
8984  const int offset_;
8985 };
8986 
8987 class StoreFloat64 : public FixedInputNodeT<2, StoreFloat64> {
8989 
8990  public:
8991  explicit StoreFloat64(uint64_t bitfield, int offset)
8992  : Base(bitfield), offset_(offset) {}
8993 
8994  static constexpr OpProperties kProperties = OpProperties::CanWrite();
8995  static constexpr typename Base::InputTypes kInputTypes{
8996  ValueRepresentation::kTagged, ValueRepresentation::kFloat64};
8997 
8998  int offset() const { return offset_; }
8999 
9000  static constexpr int kObjectIndex = 0;
9001  static constexpr int kValueIndex = 1;
9002  Input& object_input() { return input(kObjectIndex); }
9003  Input& value_input() { return input(kValueIndex); }
9004 
9007  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9008 
9009  private:
9010  const int offset_;
9011 };
9012 
9013 enum class StoreTaggedMode : uint8_t {
9014  kDefault,
9015  kInitializing,
9017 };
9019  return mode == StoreTaggedMode::kInitializing ||
9020  mode == StoreTaggedMode::kTransitioning;
9021 }
9022 
9024  : public FixedInputNodeT<2, StoreTaggedFieldNoWriteBarrier> {
9026 
9027  public:
9028  explicit StoreTaggedFieldNoWriteBarrier(uint64_t bitfield, int offset,
9029  StoreTaggedMode store_mode)
9030  : Base(bitfield | InitializingOrTransitioningField::encode(
9031  IsInitializingOrTransitioning(store_mode))),
9032  offset_(offset) {}
9033 
9034  // StoreTaggedFieldNoWriteBarrier never does a Deferred Call. However,
9035  // PhiRepresentationSelector can cause some StoreTaggedFieldNoWriteBarrier to
9036  // become StoreTaggedFieldWithWriteBarrier, which can do Deferred Calls, and
9037  // thus need the register snapshot. We thus set the DeferredCall property in
9038  // StoreTaggedFieldNoWriteBarrier so that it's allocated with enough space for
9039  // the register snapshot.
9040  static constexpr OpProperties kProperties =
9041  OpProperties::CanWrite() | OpProperties::DeferredCall();
9042  static constexpr typename Base::InputTypes kInputTypes{
9043  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9044 
9045  int offset() const { return offset_; }
9047  return InitializingOrTransitioningField::decode(bitfield());
9048  }
9049 
9050  static constexpr int kObjectIndex = 0;
9051  static constexpr int kValueIndex = 1;
9052  Input& object_input() { return input(kObjectIndex); }
9053  Input& value_input() { return input(kValueIndex); }
9054 
9055 #ifdef V8_COMPRESS_POINTERS
9056  void MarkTaggedInputsAsDecompressing() {
9057  object_input().node()->SetTaggedResultNeedsDecompress();
9058  // Don't need to decompress value to store it.
9059  }
9060 #endif
9061 
9062  int MaxCallStackArgs() const {
9063  // StoreTaggedFieldNoWriteBarrier never really does any call.
9064  return 0;
9065  }
9068  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9069 
9070  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9071 
9072  private:
9073  using InitializingOrTransitioningField = NextBitField<bool, 1>;
9074 
9075  const int offset_;
9076 };
9077 
9078 class StoreMap : public FixedInputNodeT<1, StoreMap> {
9080 
9081  public:
9082  enum class Kind {
9083  kInitializing,
9084  kInlinedAllocation,
9086  };
9087  explicit StoreMap(uint64_t bitfield, compiler::MapRef map, Kind kind)
9088  : Base(bitfield | KindField::encode(kind)), map_(map) {}
9089 
9090  static constexpr OpProperties kProperties =
9091  OpProperties::CanWrite() | OpProperties::DeferredCall();
9092  static constexpr
9093  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
9094 
9095  static constexpr int kObjectIndex = 0;
9096  Input& object_input() { return input(kObjectIndex); }
9097 
9098  compiler::MapRef map() const { return map_; }
9099  Kind kind() const { return KindField::decode(bitfield()); }
9100 
9101  int MaxCallStackArgs() const;
9104  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9105 
9106  void ClearUnstableNodeAspects(KnownNodeAspects&);
9107 
9108  private:
9109  using KindField = NextBitField<Kind, 3>;
9110  const compiler::MapRef map_;
9111 };
9112 std::ostream& operator<<(std::ostream& os, StoreMap::Kind);
9113 
9115  : public FixedInputNodeT<2, StoreTaggedFieldWithWriteBarrier> {
9117 
9118  public:
9119  explicit StoreTaggedFieldWithWriteBarrier(uint64_t bitfield, int offset,
9120  StoreTaggedMode store_mode)
9121  : Base(bitfield | InitializingOrTransitioningField::encode(
9122  IsInitializingOrTransitioning(store_mode))),
9123  offset_(offset) {}
9124 
9125  static constexpr OpProperties kProperties =
9126  OpProperties::CanWrite() | OpProperties::DeferredCall();
9127  static constexpr typename Base::InputTypes kInputTypes{
9128  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9129 
9130  int offset() const { return offset_; }
9132  return InitializingOrTransitioningField::decode(bitfield());
9133  }
9134 
9135  static constexpr int kObjectIndex = 0;
9136  static constexpr int kValueIndex = 1;
9137  Input& object_input() { return input(kObjectIndex); }
9138  Input& value_input() { return input(kValueIndex); }
9139 
9140 #ifdef V8_COMPRESS_POINTERS
9141  void MarkTaggedInputsAsDecompressing() {
9142  object_input().node()->SetTaggedResultNeedsDecompress();
9143  // Don't need to decompress value to store it.
9144  }
9145 #endif
9146 
9147  int MaxCallStackArgs() const;
9150  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9151 
9152  private:
9153  using InitializingOrTransitioningField = NextBitField<bool, 1>;
9154 
9155  const int offset_;
9156 };
9157 
9159  : public FixedInputNodeT<2, StoreContextSlotWithWriteBarrier> {
9161 
9162  public:
9163  explicit StoreContextSlotWithWriteBarrier(uint64_t bitfield, int index)
9164  : Base(bitfield), index_(index) {}
9165 
9166  static constexpr OpProperties kProperties = OpProperties::CanWrite() |
9167  OpProperties::DeferredCall() |
9168  OpProperties::LazyDeopt();
9169  static constexpr typename Base::InputTypes kInputTypes{
9170  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9171 
9172  int offset() const { return Context::OffsetOfElementAt(index()); }
9173  int index() const { return index_; }
9174 
9175  static constexpr int kContextIndex = 0;
9176  static constexpr int kNewValueIndex = 1;
9177  Input& context_input() { return input(kContextIndex); }
9178  Input& new_value_input() { return input(kNewValueIndex); }
9179 
9180 #ifdef V8_COMPRESS_POINTERS
9181  void MarkTaggedInputsAsDecompressing() {
9182  context_input().node()->SetTaggedResultNeedsDecompress();
9183  new_value_input().node()->SetTaggedResultNeedsDecompress();
9184  }
9185 #endif
9186 
9187  int MaxCallStackArgs() const;
9190  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9191 
9192  private:
9193  const int index_;
9194 };
9195 
9197  : public FixedInputNodeT<2, StoreTrustedPointerFieldWithWriteBarrier> {
9199 
9200  public:
9201  explicit StoreTrustedPointerFieldWithWriteBarrier(uint64_t bitfield,
9202  int offset,
9203  IndirectPointerTag tag,
9204  StoreTaggedMode store_mode)
9205  : Base(bitfield | InitializingOrTransitioningField::encode(
9206  IsInitializingOrTransitioning(store_mode))),
9207  offset_(offset),
9208  tag_(tag) {}
9209 
9210  static constexpr OpProperties kProperties =
9211  OpProperties::CanWrite() | OpProperties::DeferredCall();
9212  static constexpr typename Base::InputTypes kInputTypes{
9213  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9214 
9215  int offset() const { return offset_; }
9216  IndirectPointerTag tag() const { return tag_; }
9218  return InitializingOrTransitioningField::decode(bitfield());
9219  }
9220 
9221  static constexpr int kObjectIndex = 0;
9222  static constexpr int kValueIndex = 1;
9223  Input& object_input() { return input(kObjectIndex); }
9224  Input& value_input() { return input(kValueIndex); }
9225 
9226 #ifdef V8_COMPRESS_POINTERS
9227  void MarkTaggedInputsAsDecompressing() {
9228  object_input().node()->SetTaggedResultNeedsDecompress();
9229  // value is never compressed.
9230  }
9231 #endif
9232 
9233  int MaxCallStackArgs() const;
9236  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9237 
9238  private:
9239  using InitializingOrTransitioningField = NextBitField<bool, 1>;
9240 
9241  const int offset_;
9242  const IndirectPointerTag tag_;
9243 };
9244 
9245 class LoadGlobal : public FixedInputValueNodeT<1, LoadGlobal> {
9247 
9248  public:
9249  explicit LoadGlobal(uint64_t bitfield, compiler::NameRef name,
9250  const compiler::FeedbackSource& feedback,
9251  TypeofMode typeof_mode)
9252  : Base(bitfield),
9253  name_(name),
9254  feedback_(feedback),
9255  typeof_mode_(typeof_mode) {}
9256 
9257  // The implementation currently calls runtime.
9258  static constexpr OpProperties kProperties = OpProperties::JSCall();
9259  static constexpr
9260  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
9261 
9262  compiler::NameRef name() const { return name_; }
9263  compiler::FeedbackSource feedback() const { return feedback_; }
9264  TypeofMode typeof_mode() const { return typeof_mode_; }
9265 
9266  Input& context() { return input(0); }
9267 
9268  int MaxCallStackArgs() const;
9271  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9272 
9273  private:
9274  const compiler::NameRef name_;
9275  const compiler::FeedbackSource feedback_;
9276  const TypeofMode typeof_mode_;
9277 };
9278 
9279 class StoreGlobal : public FixedInputValueNodeT<2, StoreGlobal> {
9281 
9282  public:
9283  explicit StoreGlobal(uint64_t bitfield, compiler::NameRef name,
9284  const compiler::FeedbackSource& feedback)
9285  : Base(bitfield), name_(name), feedback_(feedback) {}
9286 
9287  // The implementation currently calls runtime.
9288  static constexpr OpProperties kProperties = OpProperties::JSCall();
9289  static constexpr typename Base::InputTypes kInputTypes{
9290  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9291 
9292  compiler::NameRef name() const { return name_; }
9293  compiler::FeedbackSource feedback() const { return feedback_; }
9294 
9295  Input& context() { return input(0); }
9296  Input& value() { return input(1); }
9297 
9298  int MaxCallStackArgs() const;
9301  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9302 
9303  private:
9304  const compiler::NameRef name_;
9305  const compiler::FeedbackSource feedback_;
9306 };
9307 
9309  : public FixedInputValueNodeT<3, UpdateJSArrayLength> {
9311 
9312  public:
9313  explicit UpdateJSArrayLength(uint64_t bitfield) : Base(bitfield) {}
9314 
9315  static constexpr OpProperties kProperties = OpProperties::CanWrite();
9316  static constexpr typename Base::InputTypes kInputTypes{
9317  ValueRepresentation::kInt32, ValueRepresentation::kTagged,
9318  ValueRepresentation::kInt32};
9319 
9320  // TODO(pthier): Use a more natural order once we can define the result
9321  // register to be equal to any input register.
9322  // The current order avoids any extra moves in the common case where index is
9323  // less than length
9324  static constexpr int kLengthIndex = 0;
9325  static constexpr int kObjectIndex = 1;
9326  static constexpr int kIndexIndex = 2;
9327  Input& length_input() { return input(kLengthIndex); }
9328  Input& object_input() { return input(kObjectIndex); }
9329  Input& index_input() { return input(kIndexIndex); }
9330 
9333  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9334 };
9335 
9336 class LoadNamedGeneric : public FixedInputValueNodeT<2, LoadNamedGeneric> {
9338 
9339  public:
9340  explicit LoadNamedGeneric(uint64_t bitfield, compiler::NameRef name,
9341  const compiler::FeedbackSource& feedback)
9342  : Base(bitfield), name_(name), feedback_(feedback) {}
9343 
9344  // The implementation currently calls runtime.
9345  static constexpr OpProperties kProperties = OpProperties::JSCall();
9346  static constexpr typename Base::InputTypes kInputTypes{
9347  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9348 
9349  compiler::NameRef name() const { return name_; }
9350  compiler::FeedbackSource feedback() const { return feedback_; }
9351 
9352  static constexpr int kContextIndex = 0;
9353  static constexpr int kObjectIndex = 1;
9354  Input& context() { return input(kContextIndex); }
9355  Input& object_input() { return input(kObjectIndex); }
9356 
9357  int MaxCallStackArgs() const;
9360  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9361 
9362  private:
9363  const compiler::NameRef name_;
9364  const compiler::FeedbackSource feedback_;
9365 };
9366 
9368  : public FixedInputValueNodeT<3, LoadNamedFromSuperGeneric> {
9370 
9371  public:
9372  explicit LoadNamedFromSuperGeneric(uint64_t bitfield, compiler::NameRef name,
9373  const compiler::FeedbackSource& feedback)
9374  : Base(bitfield), name_(name), feedback_(feedback) {}
9375 
9376  // The implementation currently calls runtime.
9377  static constexpr OpProperties kProperties = OpProperties::JSCall();
9378  static constexpr typename Base::InputTypes kInputTypes{
9379  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
9380  ValueRepresentation::kTagged};
9381 
9382  compiler::NameRef name() const { return name_; }
9383  compiler::FeedbackSource feedback() const { return feedback_; }
9384 
9385  static constexpr int kContextIndex = 0;
9386  static constexpr int kReceiverIndex = 1;
9387  static constexpr int kLookupStartObjectIndex = 2;
9388  Input& context() { return input(kContextIndex); }
9389  Input& receiver() { return input(kReceiverIndex); }
9390  Input& lookup_start_object() { return input(kLookupStartObjectIndex); }
9391 
9392  int MaxCallStackArgs() const;
9395  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9396 
9397  private:
9398  const compiler::NameRef name_;
9399  const compiler::FeedbackSource feedback_;
9400 };
9401 
9402 class SetNamedGeneric : public FixedInputValueNodeT<3, SetNamedGeneric> {
9404 
9405  public:
9406  explicit SetNamedGeneric(uint64_t bitfield, compiler::NameRef name,
9407  const compiler::FeedbackSource& feedback)
9408  : Base(bitfield), name_(name), feedback_(feedback) {}
9409 
9410  // The implementation currently calls runtime.
9411  static constexpr OpProperties kProperties = OpProperties::JSCall();
9412  static constexpr typename Base::InputTypes kInputTypes{
9413  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
9414  ValueRepresentation::kTagged};
9415 
9416  compiler::NameRef name() const { return name_; }
9417  compiler::FeedbackSource feedback() const { return feedback_; }
9418 
9419  static constexpr int kContextIndex = 0;
9420  static constexpr int kObjectIndex = 1;
9421  static constexpr int kValueIndex = 2;
9422  Input& context() { return input(kContextIndex); }
9423  Input& object_input() { return input(kObjectIndex); }
9424  Input& value_input() { return input(kValueIndex); }
9425 
9426  int MaxCallStackArgs() const;
9429  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9430 
9431  private:
9432  const compiler::NameRef name_;
9433  const compiler::FeedbackSource feedback_;
9434 };
9435 
9437  : public FixedInputValueNodeT<1, LoadEnumCacheLength> {
9439 
9440  public:
9441  explicit LoadEnumCacheLength(uint64_t bitfield) : Base(bitfield) {}
9442 
9443  static constexpr OpProperties kProperties =
9444  OpProperties::CanRead() | OpProperties::Int32();
9445  static constexpr
9446  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
9447 
9448  static constexpr int kMapInput = 0;
9449  Input& map_input() { return input(kMapInput); }
9450 
9453  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9454 };
9455 
9456 class StringAt : public FixedInputValueNodeT<2, StringAt> {
9458 
9459  public:
9460  explicit StringAt(uint64_t bitfield) : Base(bitfield) {}
9461 
9462  static constexpr OpProperties kProperties = OpProperties::CanRead() |
9463  OpProperties::CanAllocate() |
9464  OpProperties::DeferredCall();
9465  static constexpr typename Base::InputTypes kInputTypes{
9466  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
9467 
9468  static constexpr int kStringIndex = 0;
9469  static constexpr int kIndexIndex = 1;
9470  Input& string_input() { return input(kStringIndex); }
9471  Input& index_input() { return input(kIndexIndex); }
9472 
9473  int MaxCallStackArgs() const;
9476  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9477 };
9478 
9479 class SeqOneByteStringAt : public FixedInputValueNodeT<2, SeqOneByteStringAt> {
9481 
9482  public:
9483  explicit SeqOneByteStringAt(uint64_t bitfield) : Base(bitfield) {}
9484 
9485  static constexpr OpProperties kProperties = OpProperties::CanRead();
9486  static constexpr typename Base::InputTypes kInputTypes{
9487  ValueRepresentation::kTagged, ValueRepresentation::kInt32};
9488 
9489  static constexpr int kStringIndex = 0;
9490  static constexpr int kIndexIndex = 1;
9491  Input& string_input() { return input(kStringIndex); }
9492  Input& index_input() { return input(kIndexIndex); }
9493 
9496  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9497 };
9498 
9499 class StringLength : public FixedInputValueNodeT<1, StringLength> {
9501 
9502  public:
9503  explicit StringLength(uint64_t bitfield) : Base(bitfield) {}
9504 
9505  static constexpr OpProperties kProperties =
9506  OpProperties::CanRead() | OpProperties::Int32();
9507  static constexpr
9508  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
9509 
9510  static constexpr int kObjectIndex = 0;
9511  Input& object_input() { return input(kObjectIndex); }
9512 
9513  int MaxCallStackArgs() const;
9516  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9517 };
9518 
9519 class StringConcat : public FixedInputValueNodeT<2, StringConcat> {
9521 
9522  public:
9523  explicit StringConcat(uint64_t bitfield) : Base(bitfield) {}
9524 
9525  static constexpr OpProperties kProperties =
9526  OpProperties::Call() | OpProperties::CanAllocate() |
9527  OpProperties::LazyDeopt() | OpProperties::CanThrow();
9528  static constexpr typename Base::InputTypes kInputTypes{
9529  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9530 
9531  Input& lhs() { return Node::input(0); }
9532  Input& rhs() { return Node::input(1); }
9533 
9534  int MaxCallStackArgs() const { return 0; }
9537  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9538 };
9539 
9540 /*
9541  * This instruction takes two string map inputs and returns the result map that
9542  * is required for a cons string of these two inputs types (i.e.,
9543  * Const(One|Two)ByteStringMap).
9544  *
9545  * TODO(olivf): Remove this instruction and instead select the result map using
9546  * normal branches. This needs allocation folding support across the resulting
9547  * sub-graph.
9548  *
9549  */
9550 class ConsStringMap : public FixedInputValueNodeT<2, ConsStringMap> {
9552 
9553  public:
9554  explicit ConsStringMap(uint64_t bitfield) : Base(bitfield) {}
9555 
9556  static constexpr OpProperties kProperties = OpProperties::TaggedValue();
9557 
9558  static constexpr typename Base::InputTypes kInputTypes{
9559  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9560 
9561  Input& lhs() { return Node::input(0); }
9562  Input& rhs() { return Node::input(1); }
9563 
9564 #ifdef V8_STATIC_ROOTS
9565  void MarkTaggedInputsAsDecompressing() const {
9566  // Not needed as we just check some bits on the map ptr.
9567  }
9568 #endif
9569 
9570  int MaxCallStackArgs() const { return 0; }
9573  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9574 };
9575 
9577  : public FixedInputValueNodeT<1, UnwrapStringWrapper> {
9579 
9580  public:
9581  explicit UnwrapStringWrapper(uint64_t bitfield) : Base(bitfield) {}
9582 
9583  static constexpr OpProperties kProperties = OpProperties::TaggedValue();
9584 
9585  static constexpr
9586  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
9587 
9588  Input& value_input() { return Node::input(0); }
9589 
9590  int MaxCallStackArgs() const { return 0; }
9593  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9594 };
9595 
9597  : public FixedInputValueNodeT<3, DefineNamedOwnGeneric> {
9599 
9600  public:
9601  explicit DefineNamedOwnGeneric(uint64_t bitfield, compiler::NameRef name,
9602  const compiler::FeedbackSource& feedback)
9603  : Base(bitfield), name_(name), feedback_(feedback) {}
9604 
9605  // The implementation currently calls runtime.
9606  static constexpr OpProperties kProperties = OpProperties::JSCall();
9607  static constexpr typename Base::InputTypes kInputTypes{
9608  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
9609  ValueRepresentation::kTagged};
9610 
9611  compiler::NameRef name() const { return name_; }
9612  compiler::FeedbackSource feedback() const { return feedback_; }
9613 
9614  static constexpr int kContextIndex = 0;
9615  static constexpr int kObjectIndex = 1;
9616  static constexpr int kValueIndex = 2;
9617  Input& context() { return input(kContextIndex); }
9618  Input& object_input() { return input(kObjectIndex); }
9619  Input& value_input() { return input(kValueIndex); }
9620 
9621  int MaxCallStackArgs() const;
9624  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9625 
9626  private:
9627  const compiler::NameRef name_;
9628  const compiler::FeedbackSource feedback_;
9629 };
9630 
9632  : public FixedInputValueNodeT<4, StoreInArrayLiteralGeneric> {
9634 
9635  public:
9636  explicit StoreInArrayLiteralGeneric(uint64_t bitfield,
9637  const compiler::FeedbackSource& feedback)
9638  : Base(bitfield), feedback_(feedback) {}
9639 
9640  // The implementation currently calls runtime.
9641  static constexpr OpProperties kProperties = OpProperties::JSCall();
9642  static constexpr typename Base::InputTypes kInputTypes{
9643  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
9644  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9645 
9646  compiler::FeedbackSource feedback() const { return feedback_; }
9647 
9648  static constexpr int kContextIndex = 0;
9649  static constexpr int kObjectIndex = 1;
9650  static constexpr int kNameIndex = 2;
9651  static constexpr int kValueIndex = 3;
9652  Input& context() { return input(kContextIndex); }
9653  Input& object_input() { return input(kObjectIndex); }
9654  Input& name_input() { return input(kNameIndex); }
9655  Input& value_input() { return input(kValueIndex); }
9656 
9657  int MaxCallStackArgs() const;
9660  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9661 
9662  private:
9663  const compiler::FeedbackSource feedback_;
9664 };
9665 
9666 class GetKeyedGeneric : public FixedInputValueNodeT<3, GetKeyedGeneric> {
9668 
9669  public:
9670  explicit GetKeyedGeneric(uint64_t bitfield,
9671  const compiler::FeedbackSource& feedback)
9672  : Base(bitfield), feedback_(feedback) {}
9673 
9674  // The implementation currently calls runtime.
9675  static constexpr OpProperties kProperties = OpProperties::JSCall();
9676  static constexpr typename Base::InputTypes kInputTypes{
9677  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
9678  ValueRepresentation::kTagged};
9679 
9680  compiler::FeedbackSource feedback() const { return feedback_; }
9681 
9682  static constexpr int kContextIndex = 0;
9683  static constexpr int kObjectIndex = 1;
9684  static constexpr int kKeyIndex = 2;
9685  Input& context() { return input(kContextIndex); }
9686  Input& object_input() { return input(kObjectIndex); }
9687  Input& key_input() { return input(kKeyIndex); }
9688 
9689  int MaxCallStackArgs() const;
9692  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9693 
9694  private:
9695  const compiler::FeedbackSource feedback_;
9696 };
9697 
9698 class SetKeyedGeneric : public FixedInputValueNodeT<4, SetKeyedGeneric> {
9700 
9701  public:
9702  explicit SetKeyedGeneric(uint64_t bitfield,
9703  const compiler::FeedbackSource& feedback)
9704  : Base(bitfield), feedback_(feedback) {}
9705 
9706  // The implementation currently calls runtime.
9707  static constexpr OpProperties kProperties = OpProperties::JSCall();
9708  static constexpr typename Base::InputTypes kInputTypes{
9709  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
9710  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
9711 
9712  compiler::FeedbackSource feedback() const { return feedback_; }
9713 
9714  static constexpr int kContextIndex = 0;
9715  static constexpr int kObjectIndex = 1;
9716  static constexpr int kKeyIndex = 2;
9717  static constexpr int kValueIndex = 3;
9718  Input& context() { return input(kContextIndex); }
9719  Input& object_input() { return input(kObjectIndex); }
9720  Input& key_input() { return input(kKeyIndex); }
9721  Input& value_input() { return input(kValueIndex); }
9722 
9723  int MaxCallStackArgs() const;
9726  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9727 
9728  private:
9729  const compiler::FeedbackSource feedback_;
9730 };
9731 
9733  : public FixedInputValueNodeT<5, DefineKeyedOwnGeneric> {
9735 
9736  public:
9737  explicit DefineKeyedOwnGeneric(uint64_t bitfield,
9738  const compiler::FeedbackSource& feedback)
9739  : Base(bitfield), feedback_(feedback) {}
9740 
9741  // The implementation currently calls runtime.
9742  static constexpr OpProperties kProperties = OpProperties::JSCall();
9743  static constexpr typename Base::InputTypes kInputTypes{
9744  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
9745  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
9746  ValueRepresentation::kTagged};
9747 
9748  compiler::FeedbackSource feedback() const { return feedback_; }
9749 
9750  static constexpr int kContextIndex = 0;
9751  static constexpr int kObjectIndex = 1;
9752  static constexpr int kKeyIndex = 2;
9753  static constexpr int kValueIndex = 3;
9754  static constexpr int kFlagsIndex = 4;
9755  Input& context() { return input(kContextIndex); }
9756  Input& object_input() { return input(kObjectIndex); }
9757  Input& key_input() { return input(kKeyIndex); }
9758  Input& value_input() { return input(kValueIndex); }
9759  Input& flags_input() { return input(kFlagsIndex); }
9760 
9761  int MaxCallStackArgs() const;
9764  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
9765 
9766  private:
9767  const compiler::FeedbackSource feedback_;
9768 };
9769 
9770 class GapMove : public FixedInputNodeT<0, GapMove> {
9772 
9773  public:
9776  : Base(bitfield), source_(source), target_(target) {}
9777 
9778  compiler::AllocatedOperand source() const { return source_; }
9779  compiler::AllocatedOperand target() const { return target_; }
9780 
9783  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9784 
9785  private:
9788 };
9789 
9790 class ConstantGapMove : public FixedInputNodeT<0, ConstantGapMove> {
9792 
9793  public:
9794  ConstantGapMove(uint64_t bitfield, ValueNode* node,
9796  : Base(bitfield), node_(node), target_(target) {}
9797 
9798  compiler::AllocatedOperand target() const { return target_; }
9799  ValueNode* node() const { return node_; }
9800 
9803  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9804 
9805  private:
9806  ValueNode* node_;
9809 };
9810 
9812 
9813 // ValueRepresentation doesn't distinguish between Int32 and TruncatedInt32:
9814 // both are Int32. For Phi untagging however, it's interesting to have a
9815 // difference between the 2, as a TruncatedInt32 would allow untagging to
9816 // Float64, whereas an Int32 use wouldn't (because it would require a deopting
9817 // Float64->Int32 conversion, whereas the truncating version of this conversion
9818 // cannot deopt). We thus use a UseRepresentation to record use hints for Phis.
9819 enum class UseRepresentation : uint8_t {
9820  kTagged,
9821  kInt32,
9823  kUint32,
9824  kFloat64,
9825  kHoleyFloat64,
9826 };
9827 
9828 inline std::ostream& operator<<(std::ostream& os,
9829  const UseRepresentation& repr) {
9830  switch (repr) {
9831  case UseRepresentation::kTagged:
9832  return os << "Tagged";
9833  case UseRepresentation::kInt32:
9834  return os << "Int32";
9835  case UseRepresentation::kTruncatedInt32:
9836  return os << "TruncatedInt32";
9837  case UseRepresentation::kUint32:
9838  return os << "Uint32";
9839  case UseRepresentation::kFloat64:
9840  return os << "Float64";
9841  case UseRepresentation::kHoleyFloat64:
9842  return os << "HoleyFloat64";
9843  }
9844 }
9845 
9848 
9849 // TODO(verwaest): It may make more sense to buffer phis in merged_states until
9850 // we set up the interpreter frame state for code generation. At that point we
9851 // can generate correctly-sized phis.
9852 class Phi : public ValueNodeT<Phi> {
9853  using Base = ValueNodeT<Phi>;
9854 
9855  public:
9857 
9858  // TODO(jgruber): More intuitive constructors, if possible.
9859  Phi(uint64_t bitfield, MergePointInterpreterFrameState* merge_state,
9860  interpreter::Register owner)
9861  : Base(bitfield),
9862  owner_(owner),
9863  merge_state_(merge_state),
9865  post_loop_type_(NodeType::kUnknown) {
9866  DCHECK_NOT_NULL(merge_state);
9867  }
9868 
9869  Input& backedge_input() { return input(input_count() - 1); }
9870 
9871  interpreter::Register owner() const { return owner_; }
9873  return merge_state_;
9874  }
9875 
9876  using Node::initialize_input_null;
9877  using Node::reduce_input_count;
9878  using Node::set_input;
9879 
9880  bool is_exception_phi() const { return input_count() == 0; }
9881  bool is_loop_phi() const;
9882 
9883  bool is_backedge_offset(int i) const {
9884  return is_loop_phi() && i == input_count() - 1;
9885  }
9886 
9887  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
9888 
9889 #ifdef V8_COMPRESS_POINTERS
9890  void MarkTaggedInputsAsDecompressing() {
9891  // Do not mark inputs as decompressing here, since we don't yet know whether
9892  // this Phi needs decompression. Instead, let
9893  // Node::SetTaggedResultNeedsDecompress pass through phis.
9894  }
9895 #endif
9896 
9899  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
9900 
9901  BasicBlock* predecessor_at(int i);
9902 
9904  RecordUseReprHint(UseRepresentationSet{repr});
9905  }
9906 
9907  void RecordUseReprHint(UseRepresentationSet repr_mask);
9908 
9909  UseRepresentationSet get_uses_repr_hints() { return uses_repr_hint_; }
9911  return same_loop_uses_repr_hint_;
9912  }
9913 
9914  NodeType post_loop_type() const { return post_loop_type_; }
9916  DCHECK(!has_key());
9917  post_loop_type_ = UnionType(post_loop_type_, type);
9918  }
9920  DCHECK(!has_key());
9921  DCHECK(is_unmerged_loop_phi());
9922  post_loop_type_ = type;
9923  }
9925  DCHECK(!has_key());
9926  DCHECK(is_unmerged_loop_phi());
9927  DCHECK(NodeTypeIs(post_loop_type_, type_));
9928  type_ = post_loop_type_;
9929  }
9930 
9932  DCHECK(!has_key());
9933  type_ = UnionType(type_, type);
9934  }
9936  DCHECK(!has_key());
9937  type_ = type;
9938  }
9939  NodeType type() const {
9940  DCHECK(!has_key());
9941  return type_;
9942  }
9943 
9945  Key key() const {
9946  DCHECK(has_key());
9947  return key_;
9948  }
9949  void set_key(Key key) {
9950  set_bitfield(bitfield() | HasKeyFlag::encode(true));
9951  key_ = key;
9952  }
9953 
9954  // True if the {key_} field has been initialized.
9955  bool has_key() const { return HasKeyFlag::decode(bitfield()); }
9956 
9957  // Remembers if a use is unsafely untagged. If that happens we must ensure to
9958  // stay within the smi range, even when untagging.
9959  void SetUseRequires31BitValue();
9961  return Requires31BitValueFlag::decode(bitfield());
9962  }
9964  set_bitfield(bitfield() | Requires31BitValueFlag::encode(true));
9965  }
9966 
9967  // Check if a phi has cleared the loop.
9968  bool is_unmerged_loop_phi() const;
9969 
9970  private:
9971  Phi** next() { return &next_; }
9972 
9973  using HasKeyFlag = NextBitField<bool, 1>;
9974  using Requires31BitValueFlag = HasKeyFlag::Next<bool, 1>;
9975  using LoopPhiAfterLoopFlag = Requires31BitValueFlag::Next<bool, 1>;
9976 
9977  const interpreter::Register owner_;
9978 
9979  UseRepresentationSet uses_repr_hint_ = {};
9980  UseRepresentationSet same_loop_uses_repr_hint_ = {};
9981 
9982  Phi* next_ = nullptr;
9983  MergePointInterpreterFrameState* const merge_state_;
9984 
9985  union {
9986  struct {
9987  // The type of this Phi based on its predecessors' types.
9989  // {type_} for loop Phis should always be Unknown until their backedge has
9990  // been bound (because we don't know what will be the type of the
9991  // backedge). However, once the backedge is bound, we might be able to
9992  // refine it. {post_loop_type_} is thus used to keep track of loop Phi
9993  // types: for loop Phis, we update {post_loop_type_} when we merge
9994  // predecessors, but keep {type_} as Unknown. Once the backedge is bound,
9995  // we set {type_} as {post_loop_type_}.
9997  };
9998  // After graph building, {type_} and {post_loop_type_} are not used anymore,
9999  // so we reuse this memory to store the SnapshotTable Key for this Phi for
10000  // phi untagging.
10002  };
10003 
10005 };
10006 
10007 class Call : public ValueNodeT<Call> {
10008  using Base = ValueNodeT<Call>;
10009 
10010  public:
10011  enum class TargetType { kJSFunction, kAny };
10012  // We assume function and context as fixed inputs.
10013  static constexpr int kFunctionIndex = 0;
10014  static constexpr int kContextIndex = 1;
10015  static constexpr int kFixedInputCount = 2;
10016 
10017  // We need enough inputs to have these fixed inputs plus the maximum arguments
10018  // to a function call.
10019  static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10020 
10021  // This ctor is used when for variable input counts.
10022  // Inputs must be initialized manually.
10023  Call(uint64_t bitfield, ConvertReceiverMode mode, TargetType target_type,
10024  ValueNode* function, ValueNode* context)
10025  : Base(bitfield), receiver_mode_(mode), target_type_(target_type) {
10026  set_input(kFunctionIndex, function);
10027  set_input(kContextIndex, context);
10028  }
10029 
10030  static constexpr OpProperties kProperties = OpProperties::JSCall();
10031 
10032  Input& function() { return input(kFunctionIndex); }
10033  const Input& function() const { return input(kFunctionIndex); }
10034  Input& context() { return input(kContextIndex); }
10035  const Input& context() const { return input(kContextIndex); }
10036  int num_args() const { return input_count() - kFixedInputCount; }
10037  Input& arg(int i) { return input(i + kFixedInputCount); }
10038  void set_arg(int i, ValueNode* node) {
10039  set_input(i + kFixedInputCount, node);
10040  }
10041  auto args() {
10043  std::make_reverse_iterator(&arg(-1)),
10044  std::make_reverse_iterator(&arg(num_args() - 1)));
10045  }
10046 
10047  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10048 #ifdef V8_COMPRESS_POINTERS
10049  void MarkTaggedInputsAsDecompressing();
10050 #endif
10051  int MaxCallStackArgs() const;
10054  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10055 
10056  ConvertReceiverMode receiver_mode() const { return receiver_mode_; }
10057  TargetType target_type() const { return target_type_; }
10058 
10059  private:
10060  ConvertReceiverMode receiver_mode_;
10061  TargetType target_type_;
10062 };
10063 
10064 class Construct : public ValueNodeT<Construct> {
10065  using Base = ValueNodeT<Construct>;
10066 
10067  public:
10068  // We assume function and context as fixed inputs.
10069  static constexpr int kFunctionIndex = 0;
10070  static constexpr int kNewTargetIndex = 1;
10071  static constexpr int kContextIndex = 2;
10072  static constexpr int kFixedInputCount = 3;
10073 
10074  // We need enough inputs to have these fixed inputs plus the maximum arguments
10075  // to a function call.
10076  static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10077 
10078  // This ctor is used when for variable input counts.
10079  // Inputs must be initialized manually.
10080  Construct(uint64_t bitfield, const compiler::FeedbackSource& feedback,
10082  : Base(bitfield), feedback_(feedback) {
10083  set_input(kFunctionIndex, function);
10084  set_input(kNewTargetIndex, new_target);
10085  set_input(kContextIndex, context);
10086  }
10087 
10088  static constexpr OpProperties kProperties = OpProperties::JSCall();
10089 
10090  Input& function() { return input(kFunctionIndex); }
10091  const Input& function() const { return input(kFunctionIndex); }
10092  Input& new_target() { return input(kNewTargetIndex); }
10093  const Input& new_target() const { return input(kNewTargetIndex); }
10094  Input& context() { return input(kContextIndex); }
10095  const Input& context() const { return input(kContextIndex); }
10096  int num_args() const { return input_count() - kFixedInputCount; }
10097  Input& arg(int i) { return input(i + kFixedInputCount); }
10098  void set_arg(int i, ValueNode* node) {
10099  set_input(i + kFixedInputCount, node);
10100  }
10101  auto args() {
10103  std::make_reverse_iterator(&arg(-1)),
10104  std::make_reverse_iterator(&arg(num_args() - 1)));
10105  }
10106 
10107  compiler::FeedbackSource feedback() const { return feedback_; }
10108 
10109  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10110 #ifdef V8_COMPRESS_POINTERS
10111  void MarkTaggedInputsAsDecompressing();
10112 #endif
10113  int MaxCallStackArgs() const;
10116  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10117 
10118  private:
10119  const compiler::FeedbackSource feedback_;
10120 };
10121 
10122 class CallBuiltin : public ValueNodeT<CallBuiltin> {
10123  using Base = ValueNodeT<CallBuiltin>;
10124 
10125  public:
10126  enum FeedbackSlotType { kTaggedIndex, kSmi };
10127 
10128  // This ctor is used when for variable input counts.
10129  // Inputs must be initialized manually.
10130  CallBuiltin(uint64_t bitfield, Builtin builtin)
10131  : Base(bitfield), builtin_(builtin) {
10132  DCHECK(
10133  !Builtins::CallInterfaceDescriptorFor(builtin).HasContextParameter());
10134  }
10135 
10136  // This ctor is used when for variable input counts.
10137  // Inputs must be initialized manually.
10139  : Base(bitfield), builtin_(builtin) {
10140  DCHECK(Builtins::CallInterfaceDescriptorFor(builtin).HasContextParameter());
10141  // We use the last valid input for the context.
10142  set_input(input_count() - 1, context);
10143  }
10144 
10145  // This is an overestimation, since some builtins might not call JS code.
10146  static constexpr OpProperties kProperties = OpProperties::JSCall();
10147 
10148  bool has_feedback() const { return feedback_.has_value(); }
10150  DCHECK(has_feedback());
10151  return feedback_.value();
10152  }
10154  DCHECK(has_feedback());
10155  return slot_type_;
10156  }
10158  FeedbackSlotType slot_type) {
10159  feedback_ = feedback;
10160  slot_type_ = slot_type;
10161  }
10162 
10163  Builtin builtin() const { return builtin_; }
10165  DCHECK(
10166  Builtins::CallInterfaceDescriptorFor(builtin()).HasContextParameter());
10167  return input(input_count() - 1);
10168  }
10169 
10171  auto descriptor = Builtins::CallInterfaceDescriptorFor(builtin_);
10172  bool has_context = descriptor.HasContextParameter();
10173  int extra_input_count = has_context ? 1 : 0;
10174  return input_count() - extra_input_count;
10175  }
10176 
10178  auto descriptor = Builtins::CallInterfaceDescriptorFor(builtin_);
10179  if (has_feedback()) {
10180  int slot_index = InputCountWithoutContext();
10181  int vector_index = slot_index + 1;
10182 
10183  // There are three possibilities:
10184  // 1. Feedback slot and vector are in register.
10185  // 2. Feedback slot is in register and vector is on stack.
10186  // 3. Feedback slot and vector are on stack.
10187  if (vector_index < descriptor.GetRegisterParameterCount()) {
10188  return descriptor.GetRegisterParameterCount() - 2;
10189  } else if (vector_index == descriptor.GetRegisterParameterCount()) {
10190  return descriptor.GetRegisterParameterCount() - 1;
10191  } else {
10192  return descriptor.GetRegisterParameterCount();
10193  }
10194  }
10195  return descriptor.GetRegisterParameterCount();
10196  }
10197 
10198  auto stack_args() {
10200  std::make_reverse_iterator(&input(InputsInRegisterCount() - 1)),
10201  std::make_reverse_iterator(&input(InputCountWithoutContext() - 1)));
10202  }
10203 
10204  void set_arg(int i, ValueNode* node) { set_input(i, node); }
10205 
10206  int ReturnCount() const {
10207  return Builtins::CallInterfaceDescriptorFor(builtin_).GetReturnCount();
10208  }
10209 
10210  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10211 #ifdef V8_COMPRESS_POINTERS
10212  void MarkTaggedInputsAsDecompressing();
10213 #endif
10214  int MaxCallStackArgs() const;
10217  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10218 
10219  private:
10220  template <typename... Args>
10221  void PushArguments(MaglevAssembler* masm, Args... extra_args);
10222  void PassFeedbackSlotInRegister(MaglevAssembler*);
10223  void PushFeedbackAndArguments(MaglevAssembler*);
10224 
10225  Builtin builtin_;
10226  std::optional<compiler::FeedbackSource> feedback_;
10227  FeedbackSlotType slot_type_ = kTaggedIndex;
10228 };
10229 
10230 class CallCPPBuiltin : public ValueNodeT<CallCPPBuiltin> {
10232  // Only 1 return value with arguments on the stack is supported.
10233  static constexpr Builtin kCEntry_Builtin =
10234  Builtin::kCEntry_Return1_ArgvOnStack_BuiltinExit;
10235 
10236  public:
10237  static constexpr int kTargetIndex = 0;
10238  static constexpr int kNewTargetIndex = 1;
10239  static constexpr int kContextIndex = 2;
10240  static constexpr int kFixedInputCount = 3;
10241 
10244  : Base(bitfield), builtin_(builtin) {
10245  DCHECK(Builtins::CallInterfaceDescriptorFor(builtin).HasContextParameter());
10246  DCHECK_EQ(Builtins::CallInterfaceDescriptorFor(builtin).GetReturnCount(),
10247  1);
10248  set_input(kTargetIndex, target);
10249  set_input(kNewTargetIndex, new_target);
10250  set_input(kContextIndex, context);
10251  }
10252 
10253  // This is an overestimation, since some builtins might not call JS code.
10254  static constexpr OpProperties kProperties = OpProperties::JSCall();
10255 
10256  Builtin builtin() const { return builtin_; }
10257 
10258  Input& target() { return input(kTargetIndex); }
10259  const Input& target() const { return input(kTargetIndex); }
10260  Input& new_target() { return input(kNewTargetIndex); }
10261  const Input& new_target() const { return input(kNewTargetIndex); }
10262  Input& context() { return input(kContextIndex); }
10263  const Input& context() const { return input(kContextIndex); }
10264 
10265  int num_args() const { return input_count() - kFixedInputCount; }
10266  Input& arg(int i) { return input(i + kFixedInputCount); }
10267  void set_arg(int i, ValueNode* node) {
10268  set_input(i + kFixedInputCount, node);
10269  }
10270 
10271  auto args() {
10273  std::make_reverse_iterator(&arg(-1)),
10274  std::make_reverse_iterator(&arg(num_args() - 1)));
10275  }
10276 
10277  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10278 #ifdef V8_COMPRESS_POINTERS
10279  void MarkTaggedInputsAsDecompressing();
10280 #endif
10281  int MaxCallStackArgs() const;
10284  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10285 
10286  private:
10287  Builtin builtin_;
10288 };
10289 
10290 class CallForwardVarargs : public ValueNodeT<CallForwardVarargs> {
10292 
10293  public:
10294  static constexpr int kFunctionIndex = 0;
10295  static constexpr int kContextIndex = 1;
10296  static constexpr int kFixedInputCount = 2;
10297 
10298  // We need enough inputs to have these fixed inputs plus the maximum arguments
10299  // to a function call.
10300  static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10301 
10302  // This ctor is used when for variable input counts.
10303  // Inputs must be initialized manually.
10304  CallForwardVarargs(uint64_t bitfield, ValueNode* function, ValueNode* context,
10305  int start_index, Call::TargetType target_type)
10306  : Base(bitfield), start_index_(start_index), target_type_(target_type) {
10307  set_input(kFunctionIndex, function);
10308  set_input(kContextIndex, context);
10309  }
10310 
10311  static constexpr OpProperties kProperties = OpProperties::JSCall();
10312 
10313  Input& function() { return input(kFunctionIndex); }
10314  const Input& function() const { return input(kFunctionIndex); }
10315  Input& context() { return input(kContextIndex); }
10316  const Input& context() const { return input(kContextIndex); }
10317  int num_args() const { return input_count() - kFixedInputCount; }
10318  Input& arg(int i) { return input(i + kFixedInputCount); }
10319  void set_arg(int i, ValueNode* node) {
10320  set_input(i + kFixedInputCount, node);
10321  }
10322  auto args() {
10324  std::make_reverse_iterator(&arg(-1)),
10325  std::make_reverse_iterator(&arg(num_args() - 1)));
10326  }
10327 
10328  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10329 #ifdef V8_COMPRESS_POINTERS
10330  void MarkTaggedInputsAsDecompressing();
10331 #endif
10332  int MaxCallStackArgs() const;
10335  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10336 
10337  int start_index() const { return start_index_; }
10338  Call::TargetType target_type() const { return target_type_; }
10339 
10340  private:
10341  int start_index_;
10342  Call::TargetType target_type_;
10343 };
10344 
10345 class CallRuntime : public ValueNodeT<CallRuntime> {
10346  using Base = ValueNodeT<CallRuntime>;
10347 
10348  public:
10349  // We assume the context as fixed input.
10350  static constexpr int kContextIndex = 0;
10351  static constexpr int kFixedInputCount = 1;
10352 
10353  // This ctor is used when for variable input counts.
10354  // Inputs must be initialized manually.
10355  CallRuntime(uint64_t bitfield, Runtime::FunctionId function_id,
10356  ValueNode* context)
10357  : Base(bitfield), function_id_(function_id) {
10358  set_input(kContextIndex, context);
10359  }
10360 
10361  static constexpr OpProperties kProperties = OpProperties::JSCall();
10362 
10363  Runtime::FunctionId function_id() const { return function_id_; }
10364 
10365  Input& context() { return input(kContextIndex); }
10366  const Input& context() const { return input(kContextIndex); }
10367  int num_args() const { return input_count() - kFixedInputCount; }
10368  Input& arg(int i) { return input(i + kFixedInputCount); }
10369  void set_arg(int i, ValueNode* node) {
10370  set_input(i + kFixedInputCount, node);
10371  }
10372  auto args() {
10374  std::make_reverse_iterator(&arg(-1)),
10375  std::make_reverse_iterator(&arg(num_args() - 1)));
10376  }
10377 
10378  int ReturnCount() const {
10379  return Runtime::FunctionForId(function_id())->result_size;
10380  }
10381 
10382  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10383 #ifdef V8_COMPRESS_POINTERS
10384  void MarkTaggedInputsAsDecompressing();
10385 #endif
10386  int MaxCallStackArgs() const;
10389  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10390 
10391  private:
10392  Runtime::FunctionId function_id_;
10393 };
10394 
10395 class CallWithSpread : public ValueNodeT<CallWithSpread> {
10397 
10398  public:
10399  // We assume function and context as fixed inputs.
10400  static constexpr int kFunctionIndex = 0;
10401  static constexpr int kContextIndex = 1;
10402  static constexpr int kFixedInputCount = 2;
10403 
10404  // This ctor is used when for variable input counts.
10405  // Inputs must be initialized manually.
10406  CallWithSpread(uint64_t bitfield, ValueNode* function, ValueNode* context)
10407  : Base(bitfield) {
10408  set_input(kFunctionIndex, function);
10409  set_input(kContextIndex, context);
10410  }
10411 
10412  static constexpr OpProperties kProperties = OpProperties::JSCall();
10413 
10414  Input& function() { return input(kFunctionIndex); }
10415  const Input& function() const { return input(kFunctionIndex); }
10416  Input& context() { return input(kContextIndex); }
10417  const Input& context() const { return input(kContextIndex); }
10418  int num_args() const { return input_count() - kFixedInputCount; }
10419  int num_args_no_spread() const {
10420  DCHECK_GT(num_args(), 0);
10421  return num_args() - 1;
10422  }
10423  Input& arg(int i) { return input(i + kFixedInputCount); }
10424  void set_arg(int i, ValueNode* node) {
10425  set_input(i + kFixedInputCount, node);
10426  }
10429  std::make_reverse_iterator(&arg(-1)),
10430  std::make_reverse_iterator(&arg(num_args_no_spread() - 1)));
10431  }
10433  // Spread is the last argument/input.
10434  return input(input_count() - 1);
10435  }
10436  Input& receiver() { return arg(0); }
10437 
10438  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10439 #ifdef V8_COMPRESS_POINTERS
10440  void MarkTaggedInputsAsDecompressing();
10441 #endif
10442  int MaxCallStackArgs() const;
10445  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10446 };
10447 
10448 class CallWithArrayLike : public FixedInputValueNodeT<4, CallWithArrayLike> {
10450 
10451  public:
10452  // We assume function and context as fixed inputs.
10453  static constexpr int kFunctionIndex = 0;
10454  static constexpr int kReceiverIndex = 1;
10455  static constexpr int kArgumentsListIndex = 2;
10456  static constexpr int kContextIndex = 3;
10457 
10458  // This ctor is used when for variable input counts.
10459  // Inputs must be initialized manually.
10460  explicit CallWithArrayLike(uint64_t bitfield) : Base(bitfield) {}
10461 
10462  static constexpr OpProperties kProperties = OpProperties::JSCall();
10463  static constexpr typename Base::InputTypes kInputTypes{
10464  ValueRepresentation::kTagged, ValueRepresentation::kTagged,
10465  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
10466 
10467  Input& function() { return input(kFunctionIndex); }
10468  Input& receiver() { return input(kReceiverIndex); }
10469  Input& arguments_list() { return input(kArgumentsListIndex); }
10470  Input& context() { return input(kContextIndex); }
10471 
10472  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10473 #ifdef V8_COMPRESS_POINTERS
10474  void MarkTaggedInputsAsDecompressing();
10475 #endif
10476  int MaxCallStackArgs() const;
10479  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10480 };
10481 
10482 class CallSelf : public ValueNodeT<CallSelf> {
10483  using Base = ValueNodeT<CallSelf>;
10484 
10485  public:
10486  static constexpr int kClosureIndex = 0;
10487  static constexpr int kContextIndex = 1;
10488  static constexpr int kReceiverIndex = 2;
10489  static constexpr int kNewTargetIndex = 3;
10490  static constexpr int kFixedInputCount = 4;
10491 
10492  // We need enough inputs to have these fixed inputs plus the maximum arguments
10493  // to a function call.
10494  static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10495 
10496  // This ctor is used when for variable input counts.
10497  // Inputs must be initialized manually.
10498  CallSelf(uint64_t bitfield, int expected_parameter_count, ValueNode* closure,
10500  : Base(bitfield), expected_parameter_count_(expected_parameter_count) {
10501  set_input(kClosureIndex, closure);
10502  set_input(kContextIndex, context);
10503  set_input(kReceiverIndex, receiver);
10504  set_input(kNewTargetIndex, new_target);
10505  }
10506 
10507  static constexpr OpProperties kProperties = OpProperties::JSCall();
10508 
10509  Input& closure() { return input(kClosureIndex); }
10510  const Input& closure() const { return input(kClosureIndex); }
10511  Input& context() { return input(kContextIndex); }
10512  const Input& context() const { return input(kContextIndex); }
10513  Input& receiver() { return input(kReceiverIndex); }
10514  const Input& receiver() const { return input(kReceiverIndex); }
10515  Input& new_target() { return input(kNewTargetIndex); }
10516  const Input& new_target() const { return input(kNewTargetIndex); }
10517  int num_args() const { return input_count() - kFixedInputCount; }
10518  Input& arg(int i) { return input(i + kFixedInputCount); }
10519  void set_arg(int i, ValueNode* node) {
10520  set_input(i + kFixedInputCount, node);
10521  }
10522  auto args() {
10524  std::make_reverse_iterator(&arg(-1)),
10525  std::make_reverse_iterator(&arg(num_args() - 1)));
10526  }
10527 
10528  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10529 #ifdef V8_COMPRESS_POINTERS
10530  void MarkTaggedInputsAsDecompressing();
10531 #endif
10532  int MaxCallStackArgs() const;
10535  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10536 
10537  private:
10538  int expected_parameter_count_;
10539 };
10540 
10541 class CallKnownJSFunction : public ValueNodeT<CallKnownJSFunction> {
10543 
10544  public:
10545  static constexpr int kClosureIndex = 0;
10546  static constexpr int kContextIndex = 1;
10547  static constexpr int kReceiverIndex = 2;
10548  static constexpr int kNewTargetIndex = 3;
10549  static constexpr int kFixedInputCount = 4;
10550 
10551  // We need enough inputs to have these fixed inputs plus the maximum arguments
10552  // to a function call.
10553  static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10554 
10555  // This ctor is used when for variable input counts.
10556  // Inputs must be initialized manually.
10557  inline CallKnownJSFunction(
10558  uint64_t bitfield,
10559 #ifdef V8_ENABLE_LEAPTIERING
10560  JSDispatchHandle dispatch_handle,
10561 #endif
10562  compiler::SharedFunctionInfoRef shared_function_info, ValueNode* closure,
10564 
10565  static constexpr OpProperties kProperties = OpProperties::JSCall();
10566 
10567  Input& closure() { return input(kClosureIndex); }
10568  const Input& closure() const { return input(kClosureIndex); }
10569  Input& context() { return input(kContextIndex); }
10570  const Input& context() const { return input(kContextIndex); }
10571  Input& receiver() { return input(kReceiverIndex); }
10572  const Input& receiver() const { return input(kReceiverIndex); }
10573  Input& new_target() { return input(kNewTargetIndex); }
10574  const Input& new_target() const { return input(kNewTargetIndex); }
10575  int num_args() const { return input_count() - kFixedInputCount; }
10576  Input& arg(int i) { return input(i + kFixedInputCount); }
10577  void set_arg(int i, ValueNode* node) {
10578  set_input(i + kFixedInputCount, node);
10579  }
10580  auto args() {
10582  std::make_reverse_iterator(&arg(-1)),
10583  std::make_reverse_iterator(&arg(num_args() - 1)));
10584  }
10585 
10587  return shared_function_info_;
10588  }
10589 
10590  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10591 #ifdef V8_COMPRESS_POINTERS
10592  void MarkTaggedInputsAsDecompressing();
10593 #endif
10594  int MaxCallStackArgs() const;
10597  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10598 
10599  int expected_parameter_count() const { return expected_parameter_count_; }
10600 
10601  private:
10602 #ifdef V8_ENABLE_LEAPTIERING
10603  JSDispatchHandle dispatch_handle_;
10604 #endif
10605  const compiler::SharedFunctionInfoRef shared_function_info_;
10606  // Cache the expected parameter count so that we can access it in
10607  // MaxCallStackArgs without needing to unpark the local isolate.
10608  int expected_parameter_count_;
10609 };
10610 
10611 class CallKnownApiFunction : public ValueNodeT<CallKnownApiFunction> {
10613 
10614  public:
10615  enum Mode {
10616  // Use Builtin::kCallApiCallbackOptimizedNoProfiling.
10618  // Inline API call sequence into the generated code.
10620  // Use Builtin::kCallApiCallbackOptimized.
10622  };
10623 
10624  static constexpr int kContextIndex = 0;
10625  static constexpr int kReceiverIndex = 1;
10626  static constexpr int kFixedInputCount = 2;
10627 
10628  // We need enough inputs to have these fixed inputs plus the maximum arguments
10629  // to a function call.
10630  static_assert(kMaxInputs >= kFixedInputCount + Code::kMaxArguments);
10631 
10632  // This ctor is used when for variable input counts.
10633  // Inputs must be initialized manually.
10634  CallKnownApiFunction(uint64_t bitfield, Mode mode,
10635  compiler::FunctionTemplateInfoRef function_template_info,
10637  : Base(bitfield | ModeField::encode(mode)),
10638  function_template_info_(function_template_info) {
10639  set_input(kContextIndex, context);
10640  set_input(kReceiverIndex, receiver);
10641  }
10642 
10643  // TODO(ishell): introduce JSApiCall() which will take C++ ABI into account
10644  // when deciding which registers to splill.
10645  static constexpr OpProperties kProperties = OpProperties::JSCall();
10646 
10647  // Input& closure() { return input(kClosureIndex); }
10648  // const Input& closure() const { return input(kClosureIndex); }
10649  Input& context() { return input(kContextIndex); }
10650  const Input& context() const { return input(kContextIndex); }
10651  Input& receiver() { return input(kReceiverIndex); }
10652  const Input& receiver() const { return input(kReceiverIndex); }
10653  int num_args() const { return input_count() - kFixedInputCount; }
10654  Input& arg(int i) { return input(i + kFixedInputCount); }
10655  void set_arg(int i, ValueNode* node) {
10656  set_input(i + kFixedInputCount, node);
10657  }
10658  auto args() {
10660  std::make_reverse_iterator(&arg(-1)),
10661  std::make_reverse_iterator(&arg(num_args() - 1)));
10662  }
10663 
10664  Mode mode() const { return ModeField::decode(bitfield()); }
10665 
10667  return function_template_info_;
10668  }
10669 
10670  bool inline_builtin() const { return mode() == kNoProfilingInlined; }
10671 
10672  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10673 #ifdef V8_COMPRESS_POINTERS
10674  void MarkTaggedInputsAsDecompressing();
10675 #endif
10676  int MaxCallStackArgs() const;
10679  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10680 
10681  private:
10682  using ModeField = NextBitField<Mode, 2>;
10683 
10684  void GenerateCallApiCallbackOptimizedInline(MaglevAssembler* masm,
10685  const ProcessingState& state);
10686 
10687  const compiler::FunctionTemplateInfoRef function_template_info_;
10688  const compiler::OptionalJSObjectRef api_holder_;
10689 };
10690 
10691 class ConstructWithSpread : public ValueNodeT<ConstructWithSpread> {
10693 
10694  public:
10695  // We assume function and context as fixed inputs.
10696  static constexpr int kFunctionIndex = 0;
10697  static constexpr int kNewTargetIndex = 1;
10698  static constexpr int kContextIndex = 2;
10699  static constexpr int kFixedInputCount = 3;
10700 
10701  // This ctor is used when for variable input counts.
10702  // Inputs must be initialized manually.
10703  ConstructWithSpread(uint64_t bitfield, compiler::FeedbackSource feedback,
10704  ValueNode* function, ValueNode* new_target,
10705  ValueNode* context)
10706  : Base(bitfield), feedback_(feedback) {
10707  set_input(kFunctionIndex, function);
10708  set_input(kNewTargetIndex, new_target);
10709  set_input(kContextIndex, context);
10710  }
10711 
10712  static constexpr OpProperties kProperties = OpProperties::JSCall();
10713 
10714  Input& function() { return input(kFunctionIndex); }
10715  const Input& function() const { return input(kFunctionIndex); }
10716  Input& new_target() { return input(kNewTargetIndex); }
10717  const Input& new_target() const { return input(kNewTargetIndex); }
10718  Input& context() { return input(kContextIndex); }
10719  const Input& context() const { return input(kContextIndex); }
10720  int num_args() const { return input_count() - kFixedInputCount; }
10721  int num_args_no_spread() const {
10722  DCHECK_GT(num_args(), 0);
10723  return num_args() - 1;
10724  }
10725  Input& arg(int i) { return input(i + kFixedInputCount); }
10726  void set_arg(int i, ValueNode* node) {
10727  set_input(i + kFixedInputCount, node);
10728  }
10730  // Spread is the last argument/input.
10731  return input(input_count() - 1);
10732  }
10735  std::make_reverse_iterator(&arg(-1)),
10736  std::make_reverse_iterator(&arg(num_args_no_spread() - 1)));
10737  }
10738  compiler::FeedbackSource feedback() const { return feedback_; }
10739 
10740  void VerifyInputs(MaglevGraphLabeller* graph_labeller) const;
10741 #ifdef V8_COMPRESS_POINTERS
10742  void MarkTaggedInputsAsDecompressing();
10743 #endif
10744  int MaxCallStackArgs() const;
10747  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10748 
10749  private:
10750  const compiler::FeedbackSource feedback_;
10751 };
10752 
10753 class ConvertReceiver : public FixedInputValueNodeT<1, ConvertReceiver> {
10755 
10756  public:
10757  explicit ConvertReceiver(uint64_t bitfield,
10760  : Base(bitfield), native_context_(native_context), mode_(mode) {}
10761 
10762  Input& receiver_input() { return input(0); }
10763 
10764  // The implementation currently calls runtime.
10765  static constexpr OpProperties kProperties = OpProperties::Call() |
10766  OpProperties::CanAllocate() |
10767  OpProperties::NotIdempotent();
10768  static constexpr
10769  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
10770 
10771  int MaxCallStackArgs() const;
10774  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10775 
10776  auto options() const { return std::tuple{native_context_, mode_}; }
10777 
10778  compiler::NativeContextRef native_context() const { return native_context_; }
10779  ConvertReceiverMode mode() const { return mode_; }
10780 
10781  private:
10782  const compiler::NativeContextRef native_context_;
10783  ConvertReceiverMode mode_;
10784 };
10785 
10787  : public FixedInputValueNodeT<2, CheckConstructResult> {
10789 
10790  public:
10791  explicit CheckConstructResult(uint64_t bitfield) : Base(bitfield) {}
10792 
10793  Input& construct_result_input() { return input(0); }
10794  Input& implicit_receiver_input() { return input(1); }
10795 
10796  static constexpr typename Base::InputTypes kInputTypes{
10797  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
10798 
10799  int MaxCallStackArgs() const;
10802  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10803 };
10804 
10806  : public FixedInputValueNodeT<1, CheckDerivedConstructResult> {
10808 
10809  public:
10810  explicit CheckDerivedConstructResult(uint64_t bitfield) : Base(bitfield) {}
10811 
10812  Input& construct_result_input() { return input(0); }
10813 
10814  static constexpr OpProperties kProperties = OpProperties::CanThrow() |
10815  OpProperties::CanAllocate() |
10816  OpProperties::DeferredCall();
10817  static constexpr
10818  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
10819 
10821 
10822  int MaxCallStackArgs() const;
10825  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10826 };
10827 
10829  : public FixedInputNodeT<1, CheckJSReceiverOrNullOrUndefined> {
10831 
10832  public:
10833  explicit CheckJSReceiverOrNullOrUndefined(uint64_t bitfield,
10834  CheckType check_type)
10835  : Base(CheckTypeBitField::update(bitfield, check_type)) {}
10836 
10837  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
10838  static constexpr
10839  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
10840 
10841  Input& object_input() { return input(0); }
10842  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
10843 
10846  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10847 
10848  auto options() const { return std::tuple{check_type()}; }
10849 
10850  private:
10851  using CheckTypeBitField = NextBitField<CheckType, 1>;
10852 };
10853 
10854 class CheckNotHole : public FixedInputNodeT<1, CheckNotHole> {
10856 
10857  public:
10858  explicit CheckNotHole(uint64_t bitfield) : Base(bitfield) {}
10859 
10860  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
10861  static constexpr
10862  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
10863 
10864  Input& object_input() { return input(0); }
10865 
10868  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10869 };
10870 
10872  : public FixedInputNodeT<1, CheckHoleyFloat64NotHole> {
10874 
10875  public:
10876  explicit CheckHoleyFloat64NotHole(uint64_t bitfield) : Base(bitfield) {}
10877 
10878  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
10879  static constexpr
10880  typename Base::InputTypes kInputTypes{ValueRepresentation::kHoleyFloat64};
10881 
10882  Input& float64_input() { return input(0); }
10883 
10886  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10887 };
10888 
10890  : public FixedInputValueNodeT<1, ConvertHoleToUndefined> {
10892 
10893  public:
10894  explicit ConvertHoleToUndefined(uint64_t bitfield) : Base(bitfield) {}
10895 
10896  static constexpr
10897  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
10898 
10899  Input& object_input() { return input(0); }
10900 
10903  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10904 };
10905 
10907  : public FixedInputNodeT<0, HandleNoHeapWritesInterrupt> {
10909 
10910  public:
10911  explicit HandleNoHeapWritesInterrupt(uint64_t bitfield) : Base(bitfield) {}
10912 
10913  static constexpr OpProperties kProperties = OpProperties::DeferredCall() |
10914  OpProperties::LazyDeopt() |
10915  OpProperties::NotIdempotent();
10916 
10919  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
10920  int MaxCallStackArgs() const { return 0; }
10921 };
10922 
10924  : public FixedInputNodeT<1, ReduceInterruptBudgetForLoop> {
10926 
10927  public:
10928  explicit ReduceInterruptBudgetForLoop(uint64_t bitfield, int amount)
10929  : Base(bitfield), amount_(amount) {
10930  DCHECK_GT(amount, 0);
10931  }
10932 
10933  static constexpr
10934  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
10935 
10936  static constexpr OpProperties kProperties =
10937  OpProperties::DeferredCall() | OpProperties::CanAllocate() |
10938  OpProperties::LazyDeopt() | OpProperties::NotIdempotent();
10939 
10940  int amount() const { return amount_; }
10941 
10942  Input& feedback_cell() { return input(0); }
10943 
10944  int MaxCallStackArgs() const;
10945  void SetValueLocationConstraints();
10946  void GenerateCode(MaglevAssembler*, const ProcessingState&);
10947  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10948 
10949  private:
10950  const int amount_;
10951 };
10952 
10954  : public FixedInputNodeT<1, ReduceInterruptBudgetForReturn> {
10956 
10957  public:
10958  explicit ReduceInterruptBudgetForReturn(uint64_t bitfield, int amount)
10959  : Base(bitfield), amount_(amount) {
10960  DCHECK_GT(amount, 0);
10961  }
10962 
10963  static constexpr
10964  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
10965 
10966  static constexpr OpProperties kProperties =
10967  OpProperties::DeferredCall() | OpProperties::NotIdempotent();
10968 
10969  int amount() const { return amount_; }
10970 
10971  Input& feedback_cell() { return input(0); }
10972 
10973  int MaxCallStackArgs() const;
10974  void SetValueLocationConstraints();
10975  void GenerateCode(MaglevAssembler*, const ProcessingState&);
10976  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
10977 
10978  private:
10979  const int amount_;
10980 };
10981 
10983  : public FixedInputNodeT<1, ThrowReferenceErrorIfHole> {
10985 
10986  public:
10987  explicit ThrowReferenceErrorIfHole(uint64_t bitfield,
10988  const compiler::NameRef name)
10989  : Base(bitfield), name_(name) {}
10990 
10991  static constexpr OpProperties kProperties =
10992  OpProperties::CanThrow() | OpProperties::DeferredCall();
10993  static constexpr
10994  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
10995 
10996  compiler::NameRef name() const { return name_; }
10997 
10998  Input& value() { return Node::input(0); }
10999 
11000  int MaxCallStackArgs() const;
11003  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11004 
11005  auto options() const { return std::tuple{name_}; }
11006 
11007  private:
11008  const compiler::NameRef name_;
11009 };
11010 
11012  : public FixedInputNodeT<1, ThrowSuperNotCalledIfHole> {
11014 
11015  public:
11016  explicit ThrowSuperNotCalledIfHole(uint64_t bitfield) : Base(bitfield) {}
11017 
11018  static constexpr OpProperties kProperties =
11019  OpProperties::CanThrow() | OpProperties::DeferredCall();
11020  static constexpr
11021  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11022 
11023  Input& value() { return Node::input(0); }
11024 
11025  int MaxCallStackArgs() const;
11028  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11029 };
11030 
11032  : public FixedInputNodeT<1, ThrowSuperAlreadyCalledIfNotHole> {
11034 
11035  public:
11036  explicit ThrowSuperAlreadyCalledIfNotHole(uint64_t bitfield)
11037  : Base(bitfield) {}
11038 
11039  static constexpr OpProperties kProperties =
11040  OpProperties::CanThrow() | OpProperties::DeferredCall();
11041  static constexpr
11042  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11043 
11044  Input& value() { return Node::input(0); }
11045 
11046  int MaxCallStackArgs() const;
11049  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11050 };
11051 
11052 class ThrowIfNotCallable : public FixedInputNodeT<1, ThrowIfNotCallable> {
11054 
11055  public:
11056  explicit ThrowIfNotCallable(uint64_t bitfield) : Base(bitfield) {}
11057 
11058  static constexpr OpProperties kProperties =
11059  OpProperties::CanThrow() | OpProperties::DeferredCall();
11060  static constexpr
11061  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11062 
11063  Input& value() { return Node::input(0); }
11064 
11065  int MaxCallStackArgs() const;
11068  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11069 };
11070 
11072  : public FixedInputNodeT<2, ThrowIfNotSuperConstructor> {
11074 
11075  public:
11076  explicit ThrowIfNotSuperConstructor(uint64_t bitfield) : Base(bitfield) {}
11077 
11078  static constexpr OpProperties kProperties =
11079  OpProperties::CanThrow() | OpProperties::DeferredCall();
11080  static constexpr typename Base::InputTypes kInputTypes{
11081  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
11082 
11083  Input& constructor() { return Node::input(0); }
11084  Input& function() { return Node::input(1); }
11085 
11086  int MaxCallStackArgs() const;
11089  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11090 };
11091 
11093  : public FixedInputValueNodeT<2, TransitionElementsKind> {
11095 
11096  public:
11098  uint64_t bitfield, const ZoneVector<compiler::MapRef>& transition_sources,
11099  compiler::MapRef transition_target)
11100  : Base(bitfield),
11101  transition_sources_(transition_sources),
11102  transition_target_(transition_target) {}
11103 
11104  // TODO(leszeks): Special case the case where all transitions are fast.
11105  static constexpr OpProperties kProperties =
11106  OpProperties::AnySideEffects() | OpProperties::DeferredCall();
11107  static constexpr typename Base::InputTypes kInputTypes{
11108  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
11109 
11110  Input& object_input() { return input(0); }
11111  Input& map_input() { return input(1); }
11112 
11113  int MaxCallStackArgs() const;
11116  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11117 
11119  return transition_sources_;
11120  }
11122  return transition_target_;
11123  }
11124 
11125  private:
11126  ZoneVector<compiler::MapRef> transition_sources_;
11127  const compiler::MapRef transition_target_;
11128 };
11129 
11131  : public FixedInputNodeT<2, TransitionElementsKindOrCheckMap> {
11133 
11134  public:
11136  uint64_t bitfield, const ZoneVector<compiler::MapRef>& transition_sources,
11137  compiler::MapRef transition_target)
11138  : Base(bitfield),
11139  transition_sources_(transition_sources),
11140  transition_target_(transition_target) {}
11141 
11142  // TODO(leszeks): Special case the case where all transitions are fast.
11143  static constexpr OpProperties kProperties = OpProperties::AnySideEffects() |
11144  OpProperties::DeferredCall() |
11145  OpProperties::EagerDeopt();
11146  static constexpr typename Base::InputTypes kInputTypes{
11147  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
11148 
11149  Input& object_input() { return Node::input(0); }
11150  Input& map_input() { return Node::input(1); }
11151 
11152  int MaxCallStackArgs() const;
11155  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11156 
11158  return transition_sources_;
11159  }
11161  return transition_target_;
11162  }
11163 
11164  private:
11165  ZoneVector<compiler::MapRef> transition_sources_;
11166  const compiler::MapRef transition_target_;
11167 };
11168 
11170  : public FixedInputValueNodeT<0, GetContinuationPreservedEmbedderData> {
11172 
11173  public:
11174  explicit GetContinuationPreservedEmbedderData(uint64_t bitfield)
11175  : Base(bitfield) {}
11176 
11179  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11180 
11181  static constexpr OpProperties kProperties =
11182  OpProperties::CanRead() | OpProperties::TaggedValue();
11183 };
11184 
11186  : public FixedInputNodeT<1, SetContinuationPreservedEmbedderData> {
11188 
11189  public:
11190  explicit SetContinuationPreservedEmbedderData(uint64_t bitfield)
11191  : Base(bitfield) {}
11192 
11193  static constexpr
11194  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11195 
11196  Input& data_input() { return input(0); }
11197 
11200  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11201 
11202  static constexpr OpProperties kProperties = OpProperties::CanWrite();
11203 };
11204 
11205 class ControlNode : public NodeBase {
11206  public:
11207  // A "hole" in control flow is a control node that unconditionally interrupts
11208  // linear control flow (either by jumping or by exiting).
11209  //
11210  // A "post-dominating" hole is a hole that is guaranteed to be be reached in
11211  // control flow after this node (i.e. it is a hole that is a post-dominator
11212  // of this node).
11214  return next_post_dominating_hole_;
11215  }
11217  DCHECK_IMPLIES(node != nullptr, node->Is<UnconditionalControlNode>() ||
11218  node->Is<TerminalControlNode>() ||
11219  node->Is<Switch>());
11220  next_post_dominating_hole_ = node;
11221  }
11222 
11223  protected:
11224  using NodeBase::NodeBase;
11225 
11226  private:
11227  ControlNode* next_post_dominating_hole_ = nullptr;
11228 };
11229 
11231  public:
11232  BasicBlock* target() const { return target_.block_ptr(); }
11233  int predecessor_id() const { return predecessor_id_; }
11234  void set_predecessor_id(int id) { predecessor_id_ = id; }
11235 
11236  void set_target(BasicBlock* block) { target_.set_block_ptr(block); }
11237 
11238  protected:
11239  explicit UnconditionalControlNode(uint64_t bitfield,
11240  BasicBlockRef* target_refs)
11241  : ControlNode(bitfield), target_(target_refs) {}
11242  explicit UnconditionalControlNode(uint64_t bitfield, BasicBlock* target)
11243  : ControlNode(bitfield), target_(target) {}
11244 
11245  private:
11246  BasicBlockRef target_;
11247  int predecessor_id_ = 0;
11248 };
11249 
11250 template <class Derived>
11252  : public FixedInputNodeTMixin<0, UnconditionalControlNode, Derived> {
11253  static_assert(IsUnconditionalControlNode(NodeBase::opcode_of<Derived>));
11254 
11255  protected:
11256  explicit UnconditionalControlNodeT(uint64_t bitfield,
11257  BasicBlockRef* target_refs)
11259  bitfield, target_refs) {}
11260  explicit UnconditionalControlNodeT(uint64_t bitfield, BasicBlock* target)
11261  : FixedInputNodeTMixin<0, UnconditionalControlNode, Derived>(bitfield,
11262  target) {}
11263 };
11264 
11266  public:
11267  explicit ConditionalControlNode(uint64_t bitfield) : ControlNode(bitfield) {}
11268 };
11269 
11271  public:
11272  BranchControlNode(uint64_t bitfield, BasicBlockRef* if_true_refs,
11273  BasicBlockRef* if_false_refs)
11274  : ConditionalControlNode(bitfield),
11275  if_true_(if_true_refs),
11276  if_false_(if_false_refs) {}
11277 
11278  BasicBlock* if_true() const { return if_true_.block_ptr(); }
11279  BasicBlock* if_false() const { return if_false_.block_ptr(); }
11280 
11281  void set_if_true(BasicBlock* block) { if_true_.set_block_ptr(block); }
11282  void set_if_false(BasicBlock* block) { if_false_.set_block_ptr(block); }
11283 
11284  private:
11285  BasicBlockRef if_true_;
11286  BasicBlockRef if_false_;
11287 };
11288 
11290  protected:
11291  explicit TerminalControlNode(uint64_t bitfield) : ControlNode(bitfield) {}
11292 };
11293 
11294 template <size_t InputCount, class Derived>
11296  : public FixedInputNodeTMixin<InputCount, TerminalControlNode, Derived> {
11297  static_assert(IsTerminalControlNode(NodeBase::opcode_of<Derived>));
11298 
11299  protected:
11300  explicit TerminalControlNodeT(uint64_t bitfield)
11301  : FixedInputNodeTMixin<InputCount, TerminalControlNode, Derived>(
11302  bitfield) {}
11303 };
11304 
11305 template <size_t InputCount, class Derived>
11307  : public FixedInputNodeTMixin<InputCount, BranchControlNode, Derived> {
11308  static_assert(IsBranchControlNode(NodeBase::opcode_of<Derived>));
11309 
11310  protected:
11311  explicit BranchControlNodeT(uint64_t bitfield, BasicBlockRef* if_true_refs,
11312  BasicBlockRef* if_false_refs)
11313  : FixedInputNodeTMixin<InputCount, BranchControlNode, Derived>(
11314  bitfield, if_true_refs, if_false_refs) {}
11315 };
11316 
11317 class Jump : public UnconditionalControlNodeT<Jump> {
11319 
11320  public:
11321  Jump(uint64_t bitfield, BasicBlockRef* target_refs)
11322  : Base(bitfield, target_refs) {}
11323 
11326  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11327 };
11328 
11329 // TODO(olivf): Unify implementation with Jump.
11330 class CheckpointedJump : public UnconditionalControlNodeT<CheckpointedJump> {
11332 
11333  public:
11334  CheckpointedJump(uint64_t bitfield, BasicBlockRef* target_refs)
11335  : Base(bitfield, target_refs) {}
11336 
11337  static constexpr OpProperties kProperties =
11338  OpProperties::DeoptCheckpoint() | Base::kProperties;
11339 
11342  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11343 };
11344 
11345 class JumpLoop : public UnconditionalControlNodeT<JumpLoop> {
11347 
11348  public:
11349  explicit JumpLoop(uint64_t bitfield, BasicBlock* target)
11350  : Base(bitfield, target) {}
11351 
11352  explicit JumpLoop(uint64_t bitfield, BasicBlockRef* ref)
11353  : Base(bitfield, ref) {}
11354 
11357  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11358 
11359  base::Vector<Input> used_nodes() { return used_node_locations_; }
11361  used_node_locations_ = locations;
11362  }
11363 
11364  private:
11365  base::Vector<Input> used_node_locations_;
11366 };
11367 
11368 class Abort : public TerminalControlNodeT<0, Abort> {
11370 
11371  public:
11372  explicit Abort(uint64_t bitfield, AbortReason reason)
11373  : Base(bitfield), reason_(reason) {
11374  DCHECK_EQ(NodeBase::opcode(), opcode_of<Abort>);
11375  }
11376 
11377  static constexpr OpProperties kProperties = OpProperties::Call();
11378 
11379  AbortReason reason() const { return reason_; }
11380 
11381  int MaxCallStackArgs() const;
11384  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11385 
11386  private:
11387  const AbortReason reason_;
11388 };
11389 
11390 class Return : public TerminalControlNodeT<1, Return> {
11392 
11393  public:
11394  explicit Return(uint64_t bitfield) : Base(bitfield) {
11395  DCHECK_EQ(NodeBase::opcode(), opcode_of<Return>);
11396  }
11397 
11398  static constexpr
11399  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11400 
11401  Input& value_input() { return input(0); }
11402 
11403  void SetValueLocationConstraints();
11404  void GenerateCode(MaglevAssembler*, const ProcessingState&);
11405  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11406 };
11407 
11408 class Deopt : public TerminalControlNodeT<0, Deopt> {
11410 
11411  public:
11412  explicit Deopt(uint64_t bitfield, DeoptimizeReason reason)
11413  : Base(bitfield | ReasonField::encode(reason)) {
11414  DCHECK_EQ(NodeBase::opcode(), opcode_of<Deopt>);
11415  }
11416 
11417  static constexpr OpProperties kProperties = OpProperties::EagerDeopt();
11418 
11421  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11422 
11424 };
11425 
11426 class Switch : public FixedInputNodeTMixin<1, ConditionalControlNode, Switch> {
11428 
11429  public:
11430  explicit Switch(uint64_t bitfield, int value_base, BasicBlockRef* targets,
11431  int size)
11432  : Base(bitfield),
11433  value_base_(value_base),
11434  targets_(targets),
11435  size_(size),
11436  fallthrough_() {}
11437 
11438  explicit Switch(uint64_t bitfield, int value_base, BasicBlockRef* targets,
11439  int size, BasicBlockRef* fallthrough)
11440  : Base(bitfield),
11441  value_base_(value_base),
11442  targets_(targets),
11443  size_(size),
11444  fallthrough_(fallthrough) {}
11445 
11446  static constexpr
11447  typename Base::InputTypes kInputTypes{ValueRepresentation::kInt32};
11448 
11449  int value_base() const { return value_base_; }
11450  BasicBlockRef* targets() const { return targets_; }
11451  int size() const { return size_; }
11452 
11453  bool has_fallthrough() const { return fallthrough_.has_value(); }
11455  DCHECK(has_fallthrough());
11456  return fallthrough_.value().block_ptr();
11457  }
11458 
11459  void set_fallthrough(BasicBlock* fallthrough) {
11460  DCHECK(has_fallthrough());
11461  fallthrough_.value().set_block_ptr(fallthrough);
11462  }
11463 
11464  Input& value() { return input(0); }
11465 
11468  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11469 
11470  private:
11471  const int value_base_;
11472  BasicBlockRef* targets_;
11473  const int size_;
11474  std::optional<BasicBlockRef> fallthrough_;
11475 };
11476 
11477 class BranchIfSmi : public BranchControlNodeT<1, BranchIfSmi> {
11479 
11480  public:
11481  explicit BranchIfSmi(uint64_t bitfield, BasicBlockRef* if_true_refs,
11482  BasicBlockRef* if_false_refs)
11483  : Base(bitfield, if_true_refs, if_false_refs) {}
11484 
11485  static constexpr
11486  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11487 
11488  Input& condition_input() { return input(0); }
11489 
11490 #ifdef V8_COMPRESS_POINTERS
11491  void MarkTaggedInputsAsDecompressing() {
11492  // Don't need to decompress values to reference compare.
11493  }
11494 #endif
11495 
11498  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11499 };
11500 
11502  : public BranchControlNodeT<1, BranchIfRootConstant> {
11504 
11505  public:
11506  explicit BranchIfRootConstant(uint64_t bitfield, RootIndex root_index,
11507  BasicBlockRef* if_true_refs,
11508  BasicBlockRef* if_false_refs)
11509  : Base(bitfield, if_true_refs, if_false_refs), root_index_(root_index) {}
11510 
11511  static constexpr
11512  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11513 
11514  RootIndex root_index() { return root_index_; }
11515  Input& condition_input() { return input(0); }
11516 
11517 #ifdef V8_COMPRESS_POINTERS
11518  void MarkTaggedInputsAsDecompressing() {
11519  // Don't need to decompress values to reference compare.
11520  }
11521 #endif
11522 
11525  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11526 
11527  private:
11528  RootIndex root_index_;
11529 };
11530 
11532  : public BranchControlNodeT<1, BranchIfUndefinedOrNull> {
11534 
11535  public:
11536  explicit BranchIfUndefinedOrNull(uint64_t bitfield,
11537  BasicBlockRef* if_true_refs,
11538  BasicBlockRef* if_false_refs)
11539  : Base(bitfield, if_true_refs, if_false_refs) {}
11540 
11541  static constexpr
11542  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11543 
11544  Input& condition_input() { return input(0); }
11545 
11546 #ifdef V8_COMPRESS_POINTERS
11547  void MarkTaggedInputsAsDecompressing() {
11548  // Don't need to decompress values to reference compare.
11549  }
11550 #endif
11551 
11554  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11555 };
11556 
11558  : public BranchControlNodeT<1, BranchIfUndetectable> {
11560 
11561  public:
11562  explicit BranchIfUndetectable(uint64_t bitfield, CheckType check_type,
11563  BasicBlockRef* if_true_refs,
11564  BasicBlockRef* if_false_refs)
11565  : Base(CheckTypeBitField::update(bitfield, check_type), if_true_refs,
11566  if_false_refs) {}
11567 
11568  static constexpr
11569  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11570 
11571  Input& condition_input() { return input(0); }
11572  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
11573 
11576  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11577 
11578  private:
11579  using CheckTypeBitField = NextBitField<CheckType, 1>;
11580 };
11581 
11582 class BranchIfJSReceiver : public BranchControlNodeT<1, BranchIfJSReceiver> {
11584 
11585  public:
11586  explicit BranchIfJSReceiver(uint64_t bitfield, BasicBlockRef* if_true_refs,
11587  BasicBlockRef* if_false_refs)
11588  : Base(bitfield, if_true_refs, if_false_refs) {}
11589 
11590  static constexpr
11591  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11592 
11593  Input& condition_input() { return input(0); }
11594 
11597  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11598 };
11599 
11601  : public BranchControlNodeT<1, BranchIfToBooleanTrue> {
11603 
11604  public:
11605  explicit BranchIfToBooleanTrue(uint64_t bitfield, CheckType check_type,
11606  BasicBlockRef* if_true_refs,
11607  BasicBlockRef* if_false_refs)
11608  : Base(CheckTypeBitField::update(bitfield, check_type), if_true_refs,
11609  if_false_refs) {}
11610 
11611  static constexpr
11612  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11613 
11614  Input& condition_input() { return input(0); }
11615  CheckType check_type() const { return CheckTypeBitField::decode(bitfield()); }
11616 
11619  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11620 
11621  private:
11622  using CheckTypeBitField = NextBitField<CheckType, 1>;
11623 };
11624 
11626  : public BranchControlNodeT<1, BranchIfInt32ToBooleanTrue> {
11628 
11629  public:
11630  explicit BranchIfInt32ToBooleanTrue(uint64_t bitfield,
11631  BasicBlockRef* if_true_refs,
11632  BasicBlockRef* if_false_refs)
11633  : Base(bitfield, if_true_refs, if_false_refs) {}
11634 
11635  static constexpr
11636  typename Base::InputTypes kInputTypes{ValueRepresentation::kInt32};
11637 
11638  Input& condition_input() { return input(0); }
11639 
11642  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11643 };
11644 
11646  : public BranchControlNodeT<1, BranchIfIntPtrToBooleanTrue> {
11648 
11649  public:
11650  explicit BranchIfIntPtrToBooleanTrue(uint64_t bitfield,
11651  BasicBlockRef* if_true_refs,
11652  BasicBlockRef* if_false_refs)
11653  : Base(bitfield, if_true_refs, if_false_refs) {}
11654 
11655  static constexpr
11656  typename Base::InputTypes kInputTypes{ValueRepresentation::kIntPtr};
11657 
11658  Input& condition_input() { return input(0); }
11659 
11662  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11663 };
11664 
11666  : public BranchControlNodeT<1, BranchIfFloat64ToBooleanTrue> {
11668 
11669  public:
11670  explicit BranchIfFloat64ToBooleanTrue(uint64_t bitfield,
11671  BasicBlockRef* if_true_refs,
11672  BasicBlockRef* if_false_refs)
11673  : Base(bitfield, if_true_refs, if_false_refs) {}
11674 
11675  static constexpr
11676  typename Base::InputTypes kInputTypes{ValueRepresentation::kHoleyFloat64};
11677 
11678  Input& condition_input() { return input(0); }
11679 
11682  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11683 };
11684 
11686  : public BranchControlNodeT<1, BranchIfFloat64IsHole> {
11688 
11689  public:
11690  explicit BranchIfFloat64IsHole(uint64_t bitfield, BasicBlockRef* if_true_refs,
11691  BasicBlockRef* if_false_refs)
11692  : Base(bitfield, if_true_refs, if_false_refs) {}
11693 
11694  static constexpr
11695  typename Base::InputTypes kInputTypes{ValueRepresentation::kHoleyFloat64};
11696 
11697  Input& condition_input() { return input(0); }
11698 
11701  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11702 };
11703 
11705  : public BranchControlNodeT<2, BranchIfInt32Compare> {
11707 
11708  public:
11709  static constexpr int kLeftIndex = 0;
11710  static constexpr int kRightIndex = 1;
11711  Input& left_input() { return NodeBase::input(kLeftIndex); }
11712  Input& right_input() { return NodeBase::input(kRightIndex); }
11713 
11714  explicit BranchIfInt32Compare(uint64_t bitfield, Operation operation,
11715  BasicBlockRef* if_true_refs,
11716  BasicBlockRef* if_false_refs)
11717  : Base(bitfield, if_true_refs, if_false_refs), operation_(operation) {}
11718 
11719  static constexpr typename Base::InputTypes kInputTypes{
11720  ValueRepresentation::kInt32, ValueRepresentation::kInt32};
11721 
11724  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11725 
11726  Operation operation() const { return operation_; }
11727 
11728  private:
11729  Operation operation_;
11730 };
11731 
11733  : public BranchControlNodeT<2, BranchIfUint32Compare> {
11735 
11736  public:
11737  static constexpr int kLeftIndex = 0;
11738  static constexpr int kRightIndex = 1;
11739  Input& left_input() { return NodeBase::input(kLeftIndex); }
11740  Input& right_input() { return NodeBase::input(kRightIndex); }
11741 
11742  explicit BranchIfUint32Compare(uint64_t bitfield, Operation operation,
11743  BasicBlockRef* if_true_refs,
11744  BasicBlockRef* if_false_refs)
11745  : Base(bitfield, if_true_refs, if_false_refs), operation_(operation) {}
11746 
11747  static constexpr typename Base::InputTypes kInputTypes{
11748  ValueRepresentation::kUint32, ValueRepresentation::kUint32};
11749 
11752  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11753 
11754  Operation operation() const { return operation_; }
11755 
11756  private:
11757  Operation operation_;
11758 };
11759 
11761  : public BranchControlNodeT<2, BranchIfFloat64Compare> {
11763 
11764  public:
11765  static constexpr int kLeftIndex = 0;
11766  static constexpr int kRightIndex = 1;
11767  Input& left_input() { return NodeBase::input(kLeftIndex); }
11768  Input& right_input() { return NodeBase::input(kRightIndex); }
11769 
11770  explicit BranchIfFloat64Compare(uint64_t bitfield, Operation operation,
11771  BasicBlockRef* if_true_refs,
11772  BasicBlockRef* if_false_refs)
11773  : Base(bitfield, if_true_refs, if_false_refs), operation_(operation) {}
11774 
11775  static constexpr typename Base::InputTypes kInputTypes{
11776  ValueRepresentation::kFloat64, ValueRepresentation::kFloat64};
11777 
11780  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11781 
11782  Operation operation() const { return operation_; }
11783 
11784  private:
11785  Operation operation_;
11786 };
11787 
11789  : public BranchControlNodeT<2, BranchIfReferenceEqual> {
11791 
11792  public:
11793  static constexpr int kLeftIndex = 0;
11794  static constexpr int kRightIndex = 1;
11795  Input& left_input() { return NodeBase::input(kLeftIndex); }
11796  Input& right_input() { return NodeBase::input(kRightIndex); }
11797 
11798  explicit BranchIfReferenceEqual(uint64_t bitfield,
11799  BasicBlockRef* if_true_refs,
11800  BasicBlockRef* if_false_refs)
11801  : Base(bitfield, if_true_refs, if_false_refs) {}
11802 
11803  static constexpr typename Base::InputTypes kInputTypes{
11804  ValueRepresentation::kTagged, ValueRepresentation::kTagged};
11805 
11806 #ifdef V8_COMPRESS_POINTERS
11807  void MarkTaggedInputsAsDecompressing() {
11808  // Don't need to decompress values to reference compare.
11809  }
11810 #endif
11811 
11814  void PrintParams(std::ostream&, MaglevGraphLabeller*) const {}
11815 };
11816 
11817 class BranchIfTypeOf : public BranchControlNodeT<1, BranchIfTypeOf> {
11819 
11820  public:
11821  static constexpr int kValueIndex = 0;
11822  Input& value_input() { return NodeBase::input(kValueIndex); }
11823 
11824  explicit BranchIfTypeOf(uint64_t bitfield,
11826  BasicBlockRef* if_true_refs,
11827  BasicBlockRef* if_false_refs)
11828  : Base(bitfield, if_true_refs, if_false_refs), literal_(literal) {}
11829 
11830  static constexpr
11831  typename Base::InputTypes kInputTypes{ValueRepresentation::kTagged};
11832 
11835  void PrintParams(std::ostream&, MaglevGraphLabeller*) const;
11836 
11837  private:
11839 };
11840 
11842  switch (opcode) {
11843 #define CASE(op) \
11844  case Opcode::k##op: \
11845  return op::kProperties;
11847 #undef CASE
11848  }
11849 }
11850 
11851 template <typename Function>
11852 inline void NodeBase::ForAllInputsInRegallocAssignmentOrder(Function&& f) {
11853  auto iterate_inputs = [&](InputAllocationPolicy category) {
11854  for (Input& input : *this) {
11856  .extended_policy()) {
11857  case compiler::UnallocatedOperand::MUST_HAVE_REGISTER:
11858  if (category == InputAllocationPolicy::kArbitraryRegister)
11859  f(category, &input);
11860  break;
11861 
11862  case compiler::UnallocatedOperand::REGISTER_OR_SLOT_OR_CONSTANT:
11863  if (category == InputAllocationPolicy::kAny) f(category, &input);
11864  break;
11865 
11866  case compiler::UnallocatedOperand::FIXED_REGISTER:
11867  case compiler::UnallocatedOperand::FIXED_FP_REGISTER:
11868  if (category == InputAllocationPolicy::kFixedRegister)
11869  f(category, &input);
11870  break;
11871 
11872  case compiler::UnallocatedOperand::REGISTER_OR_SLOT:
11873  case compiler::UnallocatedOperand::SAME_AS_INPUT:
11875  case compiler::UnallocatedOperand::MUST_HAVE_SLOT:
11876  UNREACHABLE();
11877  }
11878  }
11879  };
11880 
11881  iterate_inputs(InputAllocationPolicy::kFixedRegister);
11882  iterate_inputs(InputAllocationPolicy::kArbitraryRegister);
11883  iterate_inputs(InputAllocationPolicy::kAny);
11884 }
11885 
11888 
11889 } // namespace maglev
11890 } // namespace internal
11891 } // namespace v8
11892 
11893 #endif // V8_MAGLEV_MAGLEV_IR_H_
i::DirectHandle< i::String > name
Definition: api.cc:6947
#define V(Name)
std::unordered_map< const void *, std::weak_ptr< BackingStore > > map_
Definition: backing-store.cc:760
#define T
#define CASE(Name,...)
union v8::internal::@350::BuiltinMetadata::KindSpecificData data
Builtins::Kind kind
Definition: builtins.cc:40
#define SBXCHECK_LT(lhs, rhs)
Definition: check.h:59
#define SLOW_DCHECK(condition)
Definition: checks.h:21
Definition: v8-function.h:27
Definition: v8-primitive.h:887
Definition: v8-primitive.h:905
Definition: bit-field.h:25
static constexpr U kMax
Definition: bit-field.h:44
static constexpr int kLastUsedBit
Definition: bit-field.h:42
static constexpr T decode(U value)
Definition: bit-field.h:66
static constexpr bool is_valid(T value)
Definition: bit-field.h:50
static constexpr U encode(T value)
Definition: bit-field.h:55
static constexpr V8_NODISCARD U update(U previous, T value)
Definition: bit-field.h:61
static constexpr U kMask
Definition: bit-field.h:41
static constexpr int kShift
Definition: bit-field.h:39
constexpr const auto & get() const
Definition: discriminated-union.h:83
constexpr Tag tag() const
Definition: discriminated-union.h:79
Definition: enum-set.h:20
Definition: strong-alias.h:74
Definition: threaded-list.h:35
Definition: vector.h:23
static BytecodeOffset GetContinuationBytecodeOffset(Builtin builtin)
Definition: builtins.cc:97
Definition: utils/utils.h:674
static constexpr BytecodeOffset None()
Definition: utils/utils.h:679
Definition: string.h:1014
Definition: handles.h:660
Definition: register-ppc.h:234
Definition: external-reference.h:536
Definition: utils/utils.h:645
Definition: field-index.h:22
Definition: boxed-float.h:78
bool is_nan() const
Definition: boxed-float.h:101
double get_scalar() const
Definition: boxed-float.h:95
Definition: handles.h:150
Definition: heap-number.h:28
Definition: label.h:19
Definition: local-isolate.h:45
constexpr static MachineRepresentation PointerRepresentation()
Definition: machine-type.h:169
static V8_EXPORT_PRIVATE bool BooleanValue(Tagged< Object > obj, IsolateT *isolate)
Conversion
Definition: objects.h:131
static constexpr int SizeFor(int length)
Definition: fixed-array.h:407
constexpr RegisterT first() const
Definition: reglist-base.h:111
constexpr void set(RegisterT reg)
Definition: reglist-base.h:47
constexpr bool has(RegisterT reg) const
Definition: reglist-base.h:57
constexpr void clear(RegisterT reg)
Definition: reglist-base.h:52
constexpr unsigned Count() const
Definition: reglist-base.h:66
constexpr int8_t code() const
Definition: register-base.h:43
Definition: register-arm.h:70
Definition: property-details.h:95
FunctionId
Definition: runtime.h:915
static constexpr Tagged< Smi > FromInt(int value)
Definition: smi.h:38
Definition: source-position.h:45
Definition: tagged.h:417
Definition: tagged.h:436
Definition: zone-compact-set.h:52
Definition: zone.h:321
Definition: zone-containers.h:53
Definition: zone.h:43
T * AllocateArray(size_t length)
Definition: zone.h:121
void * Allocate(size_t size)
Definition: zone.h:55
Definition: instruction.h:620
Definition: heap-refs.h:1048
Definition: heap-refs.h:1268
Definition: instruction.h:399
Definition: heap-refs.h:835
Definition: heap-refs.h:530
IndirectHandle< HeapObject > object() const
Definition: instruction.h:48
bool IsRegister() const
Definition: instruction.h:655
bool IsDoubleRegister() const
Definition: instruction.h:670
bool IsAnyStackSlot() const
Definition: instruction.h:685
bool IsAnyRegister() const
Definition: instruction.h:649
Definition: heap-refs.h:668
Definition: js-heap-broker.h:95
static LocationOperand * cast(InstructionOperand *op)
Definition: instruction.h:599
Register GetRegister() const
Definition: instruction.h:523
DoubleRegister GetDoubleRegister() const
Definition: instruction.h:533
@ REGISTER
Definition: instruction.h:499
Definition: heap-refs.h:897
Definition: heap-refs.h:813
Definition: heap-refs.h:796
Definition: heap-refs.h:1116
Definition: heap-refs.h:1183
Definition: instruction.h:188
Definition: compiler/turboshaft/types.h:509
Definition: bytecode-register.h:27
constexpr bool is_valid() const
Definition: bytecode-register.h:33
LiteralFlag
Definition: bytecode-flags-and-tokens.h:67
Definition: maglev-ir.h:11368
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Abort(uint64_t bitfield, AbortReason reason)
Definition: maglev-ir.h:11372
AbortReason reason() const
Definition: maglev-ir.h:11379
Input & object_input()
Definition: maglev-ir.h:8134
int offset() const
Definition: maglev-ir.h:8130
AbstractLoadTaggedField(uint64_t bitfield, const int offset)
Definition: maglev-ir.h:8123
void GenerateCode(MaglevAssembler *, const ProcessingState &)
auto options() const
Definition: maglev-ir.h:8140
int MaxCallStackArgs() const
Definition: maglev-ir.h:6588
AllocateElementsArray(uint64_t bitfield, AllocationType allocation_type)
Definition: maglev-ir.h:6575
void GenerateCode(MaglevAssembler *, const ProcessingState &)
AllocationType allocation_type() const
Definition: maglev-ir.h:6593
Input & length_input()
Definition: maglev-ir.h:6583
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:6591
Definition: maglev-ir.h:6460
int MaxCallStackArgs() const
Definition: maglev-ir.h:6471
void set_size(int size)
Definition: maglev-ir.h:6478
InlinedAllocation::List & allocation_list()
Definition: maglev-ir.h:6480
void set_elided_write_barriers_depend_on_type()
Definition: maglev-ir.h:6492
AllocationType allocation_type() const
Definition: maglev-ir.h:6476
int size() const
Definition: maglev-ir.h:6477
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void Add(InlinedAllocation *alloc)
Definition: maglev-ir.h:6482
AllocationBlock(uint64_t bitfield, AllocationType allocation_type)
Definition: maglev-ir.h:6464
bool elided_write_barriers_depend_on_type() const
Definition: maglev-ir.h:6489
Definition: maglev-ir.h:6536
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:6558
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int MaxCallStackArgs() const
Definition: maglev-ir.h:6555
ArgumentsElements(uint64_t bitfield, CreateArgumentsType type, int formal_parameter_count)
Definition: maglev-ir.h:6540
CreateArgumentsType type() const
Definition: maglev-ir.h:6560
int formal_parameter_count() const
Definition: maglev-ir.h:6561
Input & arguments_count_input()
Definition: maglev-ir.h:6553
Definition: maglev-ir.h:6504
ArgumentsLength(uint64_t bitfield)
Definition: maglev-ir.h:6508
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:6514
Definition: maglev-ir.h:6774
Input & right_input()
Definition: maglev-ir.h:6786
Input & left_input()
Definition: maglev-ir.h:6785
AssertCondition condition() const
Definition: maglev-ir.h:6794
AbortReason reason() const
Definition: maglev-ir.h:6795
AssertInt32(uint64_t bitfield, AssertCondition condition, AbortReason reason)
Definition: maglev-ir.h:6778
void GenerateCode(MaglevAssembler *, const ProcessingState &)
auto options() const
Definition: maglev-ir.h:6792
Definition: maglev-ir.h:1102
void Bind(BasicBlock *block)
Definition: maglev-ir.h:1167
void set_block_ptr(BasicBlock *block)
Definition: maglev-ir.h:1182
BasicBlockRef(const BasicBlockRef &)=delete
BasicBlockRef & operator=(BasicBlockRef &&)=delete
BasicBlockRef * next_ref_
Definition: maglev-ir.h:1200
BasicBlockRef * next_ref() const
Definition: maglev-ir.h:1187
BasicBlockRef * Reset()
Definition: maglev-ir.h:1147
BasicBlockRef(BasicBlockRef &&)=delete
BasicBlockRef(BasicBlock *block)
Definition: maglev-ir.h:1111
BasicBlockRef * SetToBlockAndReturnNext(BasicBlock *block)
Definition: maglev-ir.h:1134
BasicBlockRef * MoveToRefList(BasicBlockRef *ref_list_head)
Definition: maglev-ir.h:1157
BasicBlockRef(BasicBlockRef *ref_list_head)
Definition: maglev-ir.h:1126
bool has_ref() const
Definition: maglev-ir.h:1192
BasicBlockRef()
Definition: maglev-ir.h:1106
BasicBlock * block_ptr() const
Definition: maglev-ir.h:1177
BasicBlockRef & operator=(const BasicBlockRef &)=delete
BasicBlock * block_ptr_
Definition: maglev-ir.h:1199
Definition: maglev-basic-block.h:25
static constexpr int kLeftIndex
Definition: maglev-ir.h:3106
Input & left_input()
Definition: maglev-ir.h:3108
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3103
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3102
BinaryWithFeedbackNode(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:3113
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:3110
Input & right_input()
Definition: maglev-ir.h:3109
static constexpr int kRightIndex
Definition: maglev-ir.h:3107
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3119
const compiler::FeedbackSource feedback_
Definition: maglev-ir.h:3121
Definition: maglev-ir.h:11307
BranchControlNodeT(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11311
Definition: maglev-ir.h:11270
void set_if_true(BasicBlock *block)
Definition: maglev-ir.h:11281
BasicBlock * if_true() const
Definition: maglev-ir.h:11278
BasicBlock * if_false() const
Definition: maglev-ir.h:11279
void set_if_false(BasicBlock *block)
Definition: maglev-ir.h:11282
BranchControlNode(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11272
Input & left_input()
Definition: maglev-ir.h:11767
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfFloat64Compare(uint64_t bitfield, Operation operation, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11770
Input & right_input()
Definition: maglev-ir.h:11768
Operation operation() const
Definition: maglev-ir.h:11782
Definition: maglev-ir.h:11686
Input & condition_input()
Definition: maglev-ir.h:11697
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11701
BranchIfFloat64IsHole(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11690
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11682
Input & condition_input()
Definition: maglev-ir.h:11678
BranchIfFloat64ToBooleanTrue(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11670
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:11705
Input & right_input()
Definition: maglev-ir.h:11712
BranchIfInt32Compare(uint64_t bitfield, Operation operation, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11714
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Operation operation() const
Definition: maglev-ir.h:11726
Input & left_input()
Definition: maglev-ir.h:11711
BranchIfInt32ToBooleanTrue(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11630
Input & condition_input()
Definition: maglev-ir.h:11638
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11642
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & condition_input()
Definition: maglev-ir.h:11658
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11662
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfIntPtrToBooleanTrue(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11650
Definition: maglev-ir.h:11582
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11597
Input & condition_input()
Definition: maglev-ir.h:11593
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfJSReceiver(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11586
Input & left_input()
Definition: maglev-ir.h:11795
BranchIfReferenceEqual(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11798
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & right_input()
Definition: maglev-ir.h:11796
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11814
Definition: maglev-ir.h:11502
RootIndex root_index()
Definition: maglev-ir.h:11514
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & condition_input()
Definition: maglev-ir.h:11515
BranchIfRootConstant(uint64_t bitfield, RootIndex root_index, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11506
Definition: maglev-ir.h:11477
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11498
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfSmi(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11481
Input & condition_input()
Definition: maglev-ir.h:11488
Definition: maglev-ir.h:11601
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11619
CheckType check_type() const
Definition: maglev-ir.h:11615
BranchIfToBooleanTrue(uint64_t bitfield, CheckType check_type, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11605
Input & condition_input()
Definition: maglev-ir.h:11614
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:11817
Input & value_input()
Definition: maglev-ir.h:11822
BranchIfTypeOf(uint64_t bitfield, interpreter::TestTypeOfFlags::LiteralFlag literal, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11824
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:11733
Operation operation() const
Definition: maglev-ir.h:11754
Input & right_input()
Definition: maglev-ir.h:11740
Input & left_input()
Definition: maglev-ir.h:11739
void GenerateCode(MaglevAssembler *, const ProcessingState &)
BranchIfUint32Compare(uint64_t bitfield, Operation operation, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11742
BranchIfUndefinedOrNull(uint64_t bitfield, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11536
Input & condition_input()
Definition: maglev-ir.h:11544
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11554
Definition: maglev-ir.h:11558
CheckType check_type() const
Definition: maglev-ir.h:11572
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11576
Input & condition_input()
Definition: maglev-ir.h:11571
BranchIfUndetectable(uint64_t bitfield, CheckType check_type, BasicBlockRef *if_true_refs, BasicBlockRef *if_false_refs)
Definition: maglev-ir.h:11562
base::Vector< ValueNode * > parameters() const
Definition: maglev-ir.h:1726
ValueNode * context() const
Definition: maglev-ir.h:1728
BuiltinContinuationDeoptFrame(Builtin builtin_id, base::Vector< ValueNode * > parameters, ValueNode *context, compiler::OptionalJSFunctionRef maybe_js_target, DeoptFrame *parent)
Definition: maglev-ir.h:1716
ValueNode *& context()
Definition: maglev-ir.h:1727
bool is_javascript() const
Definition: maglev-ir.h:1729
compiler::JSFunctionRef javascript_target() const
Definition: maglev-ir.h:1730
const Builtin & builtin_id() const
Definition: maglev-ir.h:1725
BuiltinSeqOneByteStringCharCodeAt(uint64_t bitfield)
Definition: maglev-ir.h:7785
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & string_input()
Definition: maglev-ir.h:7795
Input & index_input()
Definition: maglev-ir.h:7796
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7800
Input & code_input()
Definition: maglev-ir.h:7732
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7737
BuiltinStringFromCharCode(uint64_t bitfield)
Definition: maglev-ir.h:7725
BuiltinStringPrototypeCharCodeOrCodePointAt(uint64_t bitfield, Mode mode)
Definition: maglev-ir.h:7752
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:10122
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:10149
CallBuiltin(uint64_t bitfield, Builtin builtin, ValueNode *context)
Definition: maglev-ir.h:10138
int ReturnCount() const
Definition: maglev-ir.h:10206
int InputCountWithoutContext() const
Definition: maglev-ir.h:10170
FeedbackSlotType slot_type() const
Definition: maglev-ir.h:10153
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10204
void set_feedback(compiler::FeedbackSource const &feedback, FeedbackSlotType slot_type)
Definition: maglev-ir.h:10157
CallBuiltin(uint64_t bitfield, Builtin builtin)
Definition: maglev-ir.h:10130
FeedbackSlotType
Definition: maglev-ir.h:10126
Builtin builtin() const
Definition: maglev-ir.h:10163
Input & context_input()
Definition: maglev-ir.h:10164
bool has_feedback() const
Definition: maglev-ir.h:10148
void GenerateCode(MaglevAssembler *, const ProcessingState &)
auto stack_args()
Definition: maglev-ir.h:10198
int InputsInRegisterCount() const
Definition: maglev-ir.h:10177
Definition: maglev-ir.h:10230
auto args()
Definition: maglev-ir.h:10271
Input & arg(int i)
Definition: maglev-ir.h:10266
Input & target()
Definition: maglev-ir.h:10258
Input & context()
Definition: maglev-ir.h:10262
Builtin builtin() const
Definition: maglev-ir.h:10256
const Input & context() const
Definition: maglev-ir.h:10263
const Input & new_target() const
Definition: maglev-ir.h:10261
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10267
CallCPPBuiltin(uint64_t bitfield, Builtin builtin, ValueNode *target, ValueNode *new_target, ValueNode *context)
Definition: maglev-ir.h:10242
const Input & target() const
Definition: maglev-ir.h:10259
Input & new_target()
Definition: maglev-ir.h:10260
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int num_args() const
Definition: maglev-ir.h:10265
Definition: maglev-ir.h:10290
Input & context()
Definition: maglev-ir.h:10315
int start_index() const
Definition: maglev-ir.h:10337
int num_args() const
Definition: maglev-ir.h:10317
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10319
Call::TargetType target_type() const
Definition: maglev-ir.h:10338
const Input & context() const
Definition: maglev-ir.h:10316
Input & arg(int i)
Definition: maglev-ir.h:10318
auto args()
Definition: maglev-ir.h:10322
CallForwardVarargs(uint64_t bitfield, ValueNode *function, ValueNode *context, int start_index, Call::TargetType target_type)
Definition: maglev-ir.h:10304
Definition: maglev-ir.h:10611
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10655
const Input & context() const
Definition: maglev-ir.h:10650
Input & receiver()
Definition: maglev-ir.h:10651
Input & context()
Definition: maglev-ir.h:10649
Input & arg(int i)
Definition: maglev-ir.h:10654
compiler::FunctionTemplateInfoRef function_template_info() const
Definition: maglev-ir.h:10666
Mode mode() const
Definition: maglev-ir.h:10664
const Input & receiver() const
Definition: maglev-ir.h:10652
auto args()
Definition: maglev-ir.h:10658
Mode
Definition: maglev-ir.h:10615
@ kGeneric
Definition: maglev-ir.h:10621
@ kNoProfilingInlined
Definition: maglev-ir.h:10619
@ kNoProfiling
Definition: maglev-ir.h:10617
bool inline_builtin() const
Definition: maglev-ir.h:10670
int num_args() const
Definition: maglev-ir.h:10653
CallKnownApiFunction(uint64_t bitfield, Mode mode, compiler::FunctionTemplateInfoRef function_template_info, ValueNode *context, ValueNode *receiver)
Definition: maglev-ir.h:10634
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:10541
compiler::SharedFunctionInfoRef shared_function_info() const
Definition: maglev-ir.h:10586
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10577
Input & closure()
Definition: maglev-ir.h:10567
const Input & closure() const
Definition: maglev-ir.h:10568
Input & receiver()
Definition: maglev-ir.h:10571
Input & context()
Definition: maglev-ir.h:10569
auto args()
Definition: maglev-ir.h:10580
int expected_parameter_count() const
Definition: maglev-ir.h:10599
Input & arg(int i)
Definition: maglev-ir.h:10576
const Input & context() const
Definition: maglev-ir.h:10570
int num_args() const
Definition: maglev-ir.h:10575
Input & new_target()
Definition: maglev-ir.h:10573
const Input & receiver() const
Definition: maglev-ir.h:10572
const Input & new_target() const
Definition: maglev-ir.h:10574
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:10345
Input & context()
Definition: maglev-ir.h:10365
Runtime::FunctionId function_id() const
Definition: maglev-ir.h:10363
const Input & context() const
Definition: maglev-ir.h:10366
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CallRuntime(uint64_t bitfield, Runtime::FunctionId function_id, ValueNode *context)
Definition: maglev-ir.h:10355
Input & arg(int i)
Definition: maglev-ir.h:10368
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10369
auto args()
Definition: maglev-ir.h:10372
int num_args() const
Definition: maglev-ir.h:10367
int ReturnCount() const
Definition: maglev-ir.h:10378
Definition: maglev-ir.h:10482
Input & closure()
Definition: maglev-ir.h:10509
int num_args() const
Definition: maglev-ir.h:10517
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const Input & new_target() const
Definition: maglev-ir.h:10516
auto args()
Definition: maglev-ir.h:10522
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10519
Input & arg(int i)
Definition: maglev-ir.h:10518
const Input & receiver() const
Definition: maglev-ir.h:10514
const Input & context() const
Definition: maglev-ir.h:10512
Input & receiver()
Definition: maglev-ir.h:10513
Input & new_target()
Definition: maglev-ir.h:10515
const Input & closure() const
Definition: maglev-ir.h:10510
CallSelf(uint64_t bitfield, int expected_parameter_count, ValueNode *closure, ValueNode *context, ValueNode *receiver, ValueNode *new_target)
Definition: maglev-ir.h:10498
Input & context()
Definition: maglev-ir.h:10511
Definition: maglev-ir.h:10448
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & receiver()
Definition: maglev-ir.h:10468
Input & context()
Definition: maglev-ir.h:10470
CallWithArrayLike(uint64_t bitfield)
Definition: maglev-ir.h:10460
Input & arguments_list()
Definition: maglev-ir.h:10469
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10479
Definition: maglev-ir.h:10395
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10424
const Input & context() const
Definition: maglev-ir.h:10417
auto args_no_spread()
Definition: maglev-ir.h:10427
Input & receiver()
Definition: maglev-ir.h:10436
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & context()
Definition: maglev-ir.h:10416
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10445
Input & arg(int i)
Definition: maglev-ir.h:10423
CallWithSpread(uint64_t bitfield, ValueNode *function, ValueNode *context)
Definition: maglev-ir.h:10406
Input & spread()
Definition: maglev-ir.h:10432
int num_args() const
Definition: maglev-ir.h:10418
int num_args_no_spread() const
Definition: maglev-ir.h:10419
Definition: maglev-ir.h:10007
const Input & context() const
Definition: maglev-ir.h:10035
ConvertReceiverMode receiver_mode() const
Definition: maglev-ir.h:10056
TargetType
Definition: maglev-ir.h:10011
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10038
auto args()
Definition: maglev-ir.h:10041
Input & context()
Definition: maglev-ir.h:10034
Call(uint64_t bitfield, ConvertReceiverMode mode, TargetType target_type, ValueNode *function, ValueNode *context)
Definition: maglev-ir.h:10023
void GenerateCode(MaglevAssembler *, const ProcessingState &)
TargetType target_type() const
Definition: maglev-ir.h:10057
Input & arg(int i)
Definition: maglev-ir.h:10037
int num_args() const
Definition: maglev-ir.h:10036
Definition: maglev-ir.h:4324
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4330
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4333
Input & input()
Definition: maglev-ir.h:4335
ChangeInt32ToFloat64(uint64_t bitfield)
Definition: maglev-ir.h:4328
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4339
ChangeIntPtrToFloat64(uint64_t bitfield)
Definition: maglev-ir.h:4366
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4377
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4371
Input & input()
Definition: maglev-ir.h:4373
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4368
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ChangeUint32ToFloat64(uint64_t bitfield)
Definition: maglev-ir.h:4347
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4349
Input & input()
Definition: maglev-ir.h:4354
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4358
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4352
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & indices_input()
Definition: maglev-ir.h:7410
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7416
CheckCacheIndicesNotCleared(uint64_t bitfield)
Definition: maglev-ir.h:7403
Input & length_input()
Definition: maglev-ir.h:7412
Definition: maglev-ir.h:10787
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10802
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckConstructResult(uint64_t bitfield)
Definition: maglev-ir.h:10791
Input & construct_result_input()
Definition: maglev-ir.h:10793
Input & implicit_receiver_input()
Definition: maglev-ir.h:10794
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10825
Input & construct_result_input()
Definition: maglev-ir.h:10812
CheckDerivedConstructResult(uint64_t bitfield)
Definition: maglev-ir.h:10810
auto options() const
Definition: maglev-ir.h:7329
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckDetectableCallable(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:7314
void PrintParams(std::ostream &out, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7327
Input & receiver_input()
Definition: maglev-ir.h:7322
CheckType check_type() const
Definition: maglev-ir.h:7323
Definition: maglev-ir.h:7038
CheckDynamicValue(uint64_t bitfield, DeoptimizeReason reason)
Definition: maglev-ir.h:7042
Input & first_input()
Definition: maglev-ir.h:7051
Input & second_input()
Definition: maglev-ir.h:7052
auto options() const
Definition: maglev-ir.h:7064
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & target_input()
Definition: maglev-ir.h:6989
auto options() const
Definition: maglev-ir.h:6995
CheckFloat64SameValue(uint64_t bitfield, Float64 value, DeoptimizeReason reason)
Definition: maglev-ir.h:6978
Float64 value() const
Definition: maglev-ir.h:6986
Definition: maglev-ir.h:7120
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckHeapObject(uint64_t bitfield)
Definition: maglev-ir.h:7124
Input & receiver_input()
Definition: maglev-ir.h:7131
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7141
Input & input()
Definition: maglev-ir.h:3658
CheckHoleyFloat64IsSmi(uint64_t bitfield)
Definition: maglev-ir.h:3652
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3654
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3662
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3656
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & float64_input()
Definition: maglev-ir.h:10882
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10886
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckHoleyFloat64NotHole(uint64_t bitfield)
Definition: maglev-ir.h:10876
Definition: maglev-ir.h:7169
InstanceType first_instance_type() const
Definition: maglev-ir.h:7199
CheckInstanceType(uint64_t bitfield, CheckType check_type, const InstanceType first_instance_type, const InstanceType last_instance_type)
Definition: maglev-ir.h:7173
Input & receiver_input()
Definition: maglev-ir.h:7187
InstanceType last_instance_type() const
Definition: maglev-ir.h:7200
auto options() const
Definition: maglev-ir.h:7195
CheckType check_type() const
Definition: maglev-ir.h:7189
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:7514
auto options() const
Definition: maglev-ir.h:7540
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckInt32Condition(uint64_t bitfield, AssertCondition condition, DeoptimizeReason reason)
Definition: maglev-ir.h:7518
AssertCondition condition() const
Definition: maglev-ir.h:7532
Input & left_input()
Definition: maglev-ir.h:7529
Input & right_input()
Definition: maglev-ir.h:7530
Definition: maglev-ir.h:3596
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & input()
Definition: maglev-ir.h:3606
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3602
CheckInt32IsSmi(uint64_t bitfield)
Definition: maglev-ir.h:3600
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3604
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3610
Definition: maglev-ir.h:3630
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3638
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckIntPtrIsSmi(uint64_t bitfield)
Definition: maglev-ir.h:3634
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3644
Input & input()
Definition: maglev-ir.h:3640
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3636
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7439
CheckJSDataViewBounds(uint64_t bitfield, ExternalArrayType element_type)
Definition: maglev-ir.h:7423
Input & index_input()
Definition: maglev-ir.h:7434
ExternalArrayType element_type() const
Definition: maglev-ir.h:7443
Input & receiver_input()
Definition: maglev-ir.h:7433
auto options() const
Definition: maglev-ir.h:7441
CheckType check_type() const
Definition: maglev-ir.h:10842
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10846
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:10841
auto options() const
Definition: maglev-ir.h:10848
CheckJSReceiverOrNullOrUndefined(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:10833
Input & map_input()
Definition: maglev-ir.h:6898
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:6897
CheckMapsWithAlreadyLoadedMap(uint64_t bitfield, base::Vector< const compiler::MapRef > maps, Zone *zone)
Definition: maglev-ir.h:6886
const compiler::ZoneRefSet< Map > & maps() const
Definition: maglev-ir.h:6895
auto options() const
Definition: maglev-ir.h:6904
CheckMapsWithAlreadyLoadedMap(uint64_t bitfield, const compiler::ZoneRefSet< Map > &maps)
Definition: maglev-ir.h:6883
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckMapsWithMigrationAndDeopt(uint64_t bitfield, base::Vector< const compiler::MapRef > maps, CheckType check_type, Zone *zone)
Definition: maglev-ir.h:6846
const compiler::ZoneRefSet< Map > & maps() const
Definition: maglev-ir.h:6860
auto options() const
Definition: maglev-ir.h:6871
CheckMapsWithMigrationAndDeopt(uint64_t bitfield, const compiler::ZoneRefSet< Map > &maps, CheckType check_type)
Definition: maglev-ir.h:6842
CheckType check_type() const
Definition: maglev-ir.h:6861
Input & receiver_input()
Definition: maglev-ir.h:6864
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckMapsWithMigration(uint64_t bitfield, const compiler::ZoneRefSet< Map > &maps, CheckType check_type)
Definition: maglev-ir.h:7340
Input & receiver_input()
Definition: maglev-ir.h:7355
CheckType check_type() const
Definition: maglev-ir.h:7356
const compiler::ZoneRefSet< Map > & maps() const
Definition: maglev-ir.h:7352
Definition: maglev-ir.h:6802
Input & receiver_input()
Definition: maglev-ir.h:6824
CheckMaps(uint64_t bitfield, base::Vector< const compiler::MapRef > maps, CheckType check_type, Zone *zone)
Definition: maglev-ir.h:6809
auto options() const
Definition: maglev-ir.h:6830
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckType check_type() const
Definition: maglev-ir.h:6821
const compiler::ZoneRefSet< Map > & maps() const
Definition: maglev-ir.h:6820
CheckMaps(uint64_t bitfield, const compiler::ZoneRefSet< Map > &maps, CheckType check_type)
Definition: maglev-ir.h:6806
Definition: maglev-ir.h:10854
Input & object_input()
Definition: maglev-ir.h:10864
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckNotHole(uint64_t bitfield)
Definition: maglev-ir.h:10858
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10868
Definition: maglev-ir.h:7095
Object::Conversion mode() const
Definition: maglev-ir.h:7108
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckNumber(uint64_t bitfield, Object::Conversion mode)
Definition: maglev-ir.h:7099
Input & receiver_input()
Definition: maglev-ir.h:7107
auto options() const
Definition: maglev-ir.h:7114
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7112
auto options() const
Definition: maglev-ir.h:7252
Input & receiver_input()
Definition: maglev-ir.h:7245
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckType check_type() const
Definition: maglev-ir.h:7246
CheckSeqOneByteString(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:7237
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7250
Definition: maglev-ir.h:7069
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7092
CheckSmi(uint64_t bitfield)
Definition: maglev-ir.h:7073
Input & receiver_input()
Definition: maglev-ir.h:7080
Definition: maglev-ir.h:7284
auto options() const
Definition: maglev-ir.h:7303
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & receiver_input()
Definition: maglev-ir.h:7296
CheckType check_type() const
Definition: maglev-ir.h:7297
CheckStringOrOddball(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:7288
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7301
CheckType check_type() const
Definition: maglev-ir.h:7272
auto options() const
Definition: maglev-ir.h:7278
Input & receiver_input()
Definition: maglev-ir.h:7271
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7276
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckStringOrStringWrapper(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:7263
Definition: maglev-ir.h:7208
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7225
void GenerateCode(MaglevAssembler *, const ProcessingState &)
auto options() const
Definition: maglev-ir.h:7227
CheckType check_type() const
Definition: maglev-ir.h:7221
CheckString(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:7212
Input & receiver_input()
Definition: maglev-ir.h:7220
Definition: maglev-ir.h:7144
auto options() const
Definition: maglev-ir.h:7163
CheckSymbol(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:7148
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7161
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & receiver_input()
Definition: maglev-ir.h:7156
CheckType check_type() const
Definition: maglev-ir.h:7157
CheckTypedArrayBounds(uint64_t bitfield)
Definition: maglev-ir.h:7499
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7511
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & length_input()
Definition: maglev-ir.h:7507
Input & index_input()
Definition: maglev-ir.h:7506
CheckTypedArrayNotDetached(uint64_t bitfield)
Definition: maglev-ir.h:7481
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7492
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:7488
Definition: maglev-ir.h:3613
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3621
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3627
Input & input()
Definition: maglev-ir.h:3623
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3619
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckUint32IsSmi(uint64_t bitfield)
Definition: maglev-ir.h:3617
CheckValueEqualsInt32(uint64_t bitfield, int32_t value, DeoptimizeReason reason)
Definition: maglev-ir.h:6949
auto options() const
Definition: maglev-ir.h:6966
Input & target_input()
Definition: maglev-ir.h:6960
int32_t value() const
Definition: maglev-ir.h:6957
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckValueEqualsString(uint64_t bitfield, compiler::InternalizedStringRef value, DeoptimizeReason reason)
Definition: maglev-ir.h:7008
Input & target_input()
Definition: maglev-ir.h:7023
auto options() const
Definition: maglev-ir.h:7030
compiler::InternalizedStringRef value() const
Definition: maglev-ir.h:7020
int MaxCallStackArgs() const
Definition: maglev-ir.h:7025
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:6910
compiler::HeapObjectRef value() const
Definition: maglev-ir.h:6922
void GenerateCode(MaglevAssembler *, const ProcessingState &)
auto options() const
Definition: maglev-ir.h:6937
CheckValue(uint64_t bitfield, const compiler::HeapObjectRef value, DeoptimizeReason reason)
Definition: maglev-ir.h:6914
Input & target_input()
Definition: maglev-ir.h:6925
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4721
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4728
int MaxCallStackArgs() const
Definition: maglev-ir.h:4725
CheckedHoleyFloat64ToFloat64(uint64_t bitfield)
Definition: maglev-ir.h:4715
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4717
Input & input()
Definition: maglev-ir.h:4723
Definition: maglev-ir.h:4225
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4241
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & input()
Definition: maglev-ir.h:4237
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4231
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4235
CheckedInt32ToUint32(uint64_t bitfield)
Definition: maglev-ir.h:4229
Definition: maglev-ir.h:4304
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4320
Input & input()
Definition: maglev-ir.h:4316
CheckedIntPtrToInt32(uint64_t bitfield)
Definition: maglev-ir.h:4308
void SetValueLocationConstraints()
Definition: maglev-ir-arm.cc:165
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4314
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4310
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:170
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4261
CheckedIntPtrToUint32(uint64_t bitfield)
Definition: maglev-ir.h:4249
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4255
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4251
Input & input()
Definition: maglev-ir.h:4257
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:7615
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7620
auto options() const
Definition: maglev-ir.h:7622
CheckedInternalizedString(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:7604
CheckType check_type() const
Definition: maglev-ir.h:7616
CheckedNumberOrOddballToFloat64(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition: maglev-ir.h:4628
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4641
CheckedNumberOrOddballToHoleyFloat64(uint64_t bitfield)
Definition: maglev-ir.h:4638
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4655
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4645
DeoptimizeReason deoptimize_reason() const
Definition: maglev-ir.h:4649
Definition: maglev-ir.h:4659
Input & input()
Definition: maglev-ir.h:4671
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4669
CheckedNumberToInt32(uint64_t bitfield)
Definition: maglev-ir.h:4663
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4665
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4675
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4033
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4042
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4036
CheckedNumberToUint8Clamped(uint64_t bitfield)
Definition: maglev-ir.h:4031
Input & input()
Definition: maglev-ir.h:4038
Definition: maglev-ir.h:7629
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CheckType check_type() const
Definition: maglev-ir.h:7644
auto options() const
Definition: maglev-ir.h:7651
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7649
Input & object_input()
Definition: maglev-ir.h:7643
CheckedObjectToIndex(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:7633
Definition: maglev-ir.h:3378
CheckedSmiDecrement(uint64_t bitfield)
Definition: maglev-ir.h:3382
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3393
Input & value_input()
Definition: maglev-ir.h:3389
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3384
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3386
static constexpr int kValueIndex
Definition: maglev-ir.h:3388
Definition: maglev-ir.h:3359
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3367
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr int kValueIndex
Definition: maglev-ir.h:3369
CheckedSmiIncrement(uint64_t bitfield)
Definition: maglev-ir.h:3363
Input & value_input()
Definition: maglev-ir.h:3370
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3365
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3374
Definition: maglev-ir.h:3688
Input & input()
Definition: maglev-ir.h:3700
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3704
CheckedSmiSizedInt32(uint64_t bitfield)
Definition: maglev-ir.h:3692
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3694
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3698
Definition: maglev-ir.h:4205
int MaxCallStackArgs() const
Definition: maglev-ir.h:4218
CheckedSmiTagFloat64(uint64_t bitfield)
Definition: maglev-ir.h:4209
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4211
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4221
Input & input()
Definition: maglev-ir.h:4216
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4213
Definition: maglev-ir.h:3665
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3671
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3674
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3680
CheckedSmiTagInt32(uint64_t bitfield)
Definition: maglev-ir.h:3669
Input & input()
Definition: maglev-ir.h:3676
Definition: maglev-ir.h:3727
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3733
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3742
Input & input()
Definition: maglev-ir.h:3738
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3736
CheckedSmiTagIntPtr(uint64_t bitfield)
Definition: maglev-ir.h:3731
Definition: maglev-ir.h:3708
Input & input()
Definition: maglev-ir.h:3719
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3714
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3717
CheckedSmiTagUint32(uint64_t bitfield)
Definition: maglev-ir.h:3712
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3723
Definition: maglev-ir.h:3817
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3839
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3823
CheckedSmiUntag(uint64_t bitfield)
Definition: maglev-ir.h:3821
Input & input()
Definition: maglev-ir.h:3829
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3827
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4397
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4391
CheckedTruncateFloat64ToInt32(uint64_t bitfield)
Definition: maglev-ir.h:4385
Input & input()
Definition: maglev-ir.h:4393
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4387
Input & input()
Definition: maglev-ir.h:4543
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4539
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4547
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4537
CheckedTruncateFloat64ToUint32(uint64_t bitfield)
Definition: maglev-ir.h:4535
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7820
TaggedToFloat64ConversionType conversion_type() const
Definition: maglev-ir.h:4858
CheckedTruncateNumberOrOddballToInt32(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition: maglev-ir.h:4842
auto options() const
Definition: maglev-ir.h:4862
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4847
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4850
Definition: maglev-ir.h:4284
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4294
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4290
CheckedUint32ToInt32(uint64_t bitfield)
Definition: maglev-ir.h:4288
Input & input()
Definition: maglev-ir.h:4296
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4300
Definition: maglev-ir.h:11330
CheckpointedJump(uint64_t bitfield, BasicBlockRef *target_refs)
Definition: maglev-ir.h:11334
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11342
Definition: maglev-interpreter-frame-state.h:582
ConditionalControlNode(uint64_t bitfield)
Definition: maglev-ir.h:11267
Definition: maglev-ir.h:9550
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & rhs()
Definition: maglev-ir.h:9562
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9573
int MaxCallStackArgs() const
Definition: maglev-ir.h:9570
ConsStringMap(uint64_t bitfield)
Definition: maglev-ir.h:9554
Input & lhs()
Definition: maglev-ir.h:9561
Definition: maglev-ir.h:9790
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ConstantGapMove(uint64_t bitfield, ValueNode *node, compiler::AllocatedOperand target)
Definition: maglev-ir.h:9794
compiler::AllocatedOperand target() const
Definition: maglev-ir.h:9798
ValueNode * node() const
Definition: maglev-ir.h:9799
Definition: maglev-ir.h:5592
bool IsTheHole(compiler::JSHeapBroker *broker) const
Definition: maglev-ir.h:5605
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:5601
compiler::HeapObjectRef object()
Definition: maglev-ir.h:5613
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7587
Constant(uint64_t bitfield, compiler::HeapObjectRef object)
Definition: maglev-ir.h:5598
compiler::HeapObjectRef ref() const
Definition: maglev-ir.h:5618
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:913
const MaglevCompilationUnit & unit() const
Definition: maglev-ir.h:1684
ValueNode *& receiver()
Definition: maglev-ir.h:1685
ValueNode *& context()
Definition: maglev-ir.h:1687
SourcePosition source_position() const
Definition: maglev-ir.h:1689
ValueNode * receiver() const
Definition: maglev-ir.h:1686
ValueNode * context() const
Definition: maglev-ir.h:1688
ConstructInvokeStubDeoptFrame(const MaglevCompilationUnit &unit, SourcePosition source_position, ValueNode *receiver, ValueNode *context, DeoptFrame *parent)
Definition: maglev-ir.h:1676
Definition: maglev-ir.h:10691
const Input & new_target() const
Definition: maglev-ir.h:10717
int num_args_no_spread() const
Definition: maglev-ir.h:10721
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:10738
auto args_no_spread()
Definition: maglev-ir.h:10733
Input & new_target()
Definition: maglev-ir.h:10716
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10726
int num_args() const
Definition: maglev-ir.h:10720
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10747
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & spread()
Definition: maglev-ir.h:10729
ConstructWithSpread(uint64_t bitfield, compiler::FeedbackSource feedback, ValueNode *function, ValueNode *new_target, ValueNode *context)
Definition: maglev-ir.h:10703
const Input & context() const
Definition: maglev-ir.h:10719
Input & context()
Definition: maglev-ir.h:10718
Input & arg(int i)
Definition: maglev-ir.h:10725
Definition: maglev-ir.h:10064
void set_arg(int i, ValueNode *node)
Definition: maglev-ir.h:10098
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10116
const Input & context() const
Definition: maglev-ir.h:10095
Input & arg(int i)
Definition: maglev-ir.h:10097
int num_args() const
Definition: maglev-ir.h:10096
Input & context()
Definition: maglev-ir.h:10094
Construct(uint64_t bitfield, const compiler::FeedbackSource &feedback, ValueNode *function, ValueNode *new_target, ValueNode *context)
Definition: maglev-ir.h:10080
auto args()
Definition: maglev-ir.h:10101
const Input & new_target() const
Definition: maglev-ir.h:10093
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:10107
Input & new_target()
Definition: maglev-ir.h:10092
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:11205
void set_next_post_dominating_hole(ControlNode *node)
Definition: maglev-ir.h:11216
ControlNode * next_post_dominating_hole() const
Definition: maglev-ir.h:11213
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:10899
ConvertHoleToUndefined(uint64_t bitfield)
Definition: maglev-ir.h:10894
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10903
Definition: maglev-ir.h:10753
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10774
compiler::NativeContextRef native_context() const
Definition: maglev-ir.h:10778
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & receiver_input()
Definition: maglev-ir.h:10762
auto options() const
Definition: maglev-ir.h:10776
ConvertReceiver(uint64_t bitfield, compiler::NativeContextRef native_context, ConvertReceiverMode mode)
Definition: maglev-ir.h:10757
ConvertReceiverMode mode() const
Definition: maglev-ir.h:10779
Definition: maglev-ir.h:5677
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5703
int flags() const
Definition: maglev-ir.h:5692
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5695
CreateArrayLiteral(uint64_t bitfield, compiler::HeapObjectRef constant_elements, const compiler::FeedbackSource &feedback, int flags)
Definition: maglev-ir.h:5681
compiler::HeapObjectRef constant_elements()
Definition: maglev-ir.h:5690
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:5691
Definition: maglev-ir.h:6701
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CreateClosure(uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info, compiler::FeedbackCellRef feedback_cell, bool pretenured)
Definition: maglev-ir.h:6705
Input & context()
Definition: maglev-ir.h:6720
bool pretenured() const
Definition: maglev-ir.h:6718
compiler::FeedbackCellRef feedback_cell() const
Definition: maglev-ir.h:6717
compiler::SharedFunctionInfoRef shared_function_info() const
Definition: maglev-ir.h:6714
AllocationType allocation_type() const
Definition: maglev-ir.h:7885
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7897
Input & length_input()
Definition: maglev-ir.h:7893
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CreateFastArrayElements(uint64_t bitfield, AllocationType allocation_type)
Definition: maglev-ir.h:7881
uint32_t slot_count() const
Definition: maglev-ir.h:6613
Input & context()
Definition: maglev-ir.h:6616
compiler::ScopeInfoRef scope_info() const
Definition: maglev-ir.h:6612
ScopeType scope_type() const
Definition: maglev-ir.h:6614
void GenerateCode(MaglevAssembler *, const ProcessingState &)
CreateFunctionContext(uint64_t bitfield, compiler::ScopeInfoRef scope_info, uint32_t slot_count, ScopeType scope_type)
Definition: maglev-ir.h:6604
Definition: maglev-ir.h:5745
int flags() const
Definition: maglev-ir.h:5762
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:5761
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5773
compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor()
Definition: maglev-ir.h:5758
CreateObjectLiteral(uint64_t bitfield, compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor, const compiler::FeedbackSource &feedback, int flags)
Definition: maglev-ir.h:5749
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5765
Definition: maglev-ir.h:6672
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:6693
CreateRegExpLiteral(uint64_t bitfield, compiler::StringRef pattern, const compiler::FeedbackSource &feedback, int flags)
Definition: maglev-ir.h:6676
int flags() const
Definition: maglev-ir.h:6683
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:6682
compiler::StringRef pattern()
Definition: maglev-ir.h:6681
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5730
CreateShallowArrayLiteral(uint64_t bitfield, compiler::HeapObjectRef constant_elements, const compiler::FeedbackSource &feedback, int flags)
Definition: maglev-ir.h:5716
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:5726
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::HeapObjectRef constant_elements()
Definition: maglev-ir.h:5725
int flags() const
Definition: maglev-ir.h:5727
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5736
compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor()
Definition: maglev-ir.h:5797
int flags() const
Definition: maglev-ir.h:5801
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5804
CreateShallowObjectLiteral(uint64_t bitfield, compiler::ObjectBoilerplateDescriptionRef boilerplate_descriptor, const compiler::FeedbackSource &feedback, int flags)
Definition: maglev-ir.h:5786
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5810
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:5800
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:7564
void MarkTaggedInputsAsDecompressing()
Definition: maglev-ir.h:7572
void VerifyInputs(MaglevGraphLabeller *) const
Definition: maglev-ir.h:7571
void SetValueLocationConstraints()
Definition: maglev-ir.h:7568
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7570
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:7569
Definition: maglev-ir.h:7551
void GenerateCode(MaglevAssembler *, const ProcessingState &)
DebugBreak(uint64_t bitfield)
Definition: maglev-ir.h:7555
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7561
Input & flags_input()
Definition: maglev-ir.h:9759
Input & key_input()
Definition: maglev-ir.h:9757
Input & value_input()
Definition: maglev-ir.h:9758
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9764
Input & context()
Definition: maglev-ir.h:9755
DefineKeyedOwnGeneric(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9737
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9748
Input & object_input()
Definition: maglev-ir.h:9756
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value_input()
Definition: maglev-ir.h:9619
compiler::NameRef name() const
Definition: maglev-ir.h:9611
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9612
Input & context()
Definition: maglev-ir.h:9617
void GenerateCode(MaglevAssembler *, const ProcessingState &)
DefineNamedOwnGeneric(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9601
Input & object_input()
Definition: maglev-ir.h:9618
Definition: maglev-ir.h:5149
LanguageMode mode() const
Definition: maglev-ir.h:5166
Input & context()
Definition: maglev-ir.h:5162
DeleteProperty(uint64_t bitfield, LanguageMode mode)
Definition: maglev-ir.h:5153
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7597
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5158
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5157
Input & object()
Definition: maglev-ir.h:5163
Input & key()
Definition: maglev-ir.h:5164
Definition: maglev-ir.h:1511
SourcePosition GetSourcePosition() const
Definition: maglev-ir.h:1798
const InlinedArgumentsDeoptFrame & as_inlined_arguments() const
Definition: maglev-ir.h:1664
const ConstructInvokeStubDeoptFrame & as_construct_stub() const
Definition: maglev-ir.h:1703
VirtualObjectList GetVirtualObjects() const
Definition: maglev-interpreter-frame-state.h:1176
compiler::SharedFunctionInfoRef GetSharedFunctionInfo() const
Definition: maglev-ir.h:1813
DeoptFrame(InterpretedFrameData &&data, DeoptFrame *parent)
Definition: maglev-ir.h:1581
DeoptFrame * parent()
Definition: maglev-ir.h:1560
const DeoptFrame * parent() const
Definition: maglev-ir.h:1561
DeoptFrame(const FrameData &data, DeoptFrame *parent)
Definition: maglev-ir.h:1556
FrameData data_
Definition: maglev-ir.h:1590
bool IsJsFrame() const
Definition: maglev-ir.h:1756
DeoptFrame(FrameData &&data, DeoptFrame *parent)
Definition: maglev-ir.h:1553
DeoptFrame(InlinedArgumentsFrameData &&data, DeoptFrame *parent)
Definition: maglev-ir.h:1583
const InterpretedDeoptFrame & as_interpreted() const
Definition: maglev-ir.h:1626
const MaglevCompilationUnit & GetCompilationUnit() const
Definition: maglev-ir.h:1770
compiler::BytecodeArrayRef GetBytecodeArray() const
Definition: maglev-ir.h:1818
FrameType
Definition: maglev-ir.h:1513
DeoptFrame(ConstructInvokeStubFrameData &&data, DeoptFrame *parent)
Definition: maglev-ir.h:1585
DeoptFrame *const parent_
Definition: maglev-ir.h:1591
const BuiltinContinuationDeoptFrame & as_builtin_continuation() const
Definition: maglev-ir.h:1747
FrameType type() const
Definition: maglev-ir.h:1559
BytecodeOffset GetBytecodeOffset() const
Definition: maglev-ir.h:1783
DeoptFrame(BuiltinContinuationFrameData &&data, DeoptFrame *parent)
Definition: maglev-ir.h:1587
Definition: maglev-ir.h:1822
InputLocation * input_locations() const
Definition: maglev-ir.h:1835
const DeoptFrame & top_frame() const
Definition: maglev-ir.h:1829
void set_translation_index(int index)
Definition: maglev-ir.h:1844
bool has_input_locations() const
Definition: maglev-ir.h:1834
DeoptFrame & top_frame()
Definition: maglev-ir.h:1828
void InitializeInputLocations(Zone *zone, size_t count)
Definition: maglev-ir.cc:341
const compiler::FeedbackSource & feedback_to_update() const
Definition: maglev-ir.h:1830
int translation_index() const
Definition: maglev-ir.h:1843
DeoptInfo(Zone *zone, const DeoptFrame top_frame, compiler::FeedbackSource feedback_to_update)
Definition: maglev-ir.cc:384
Label * deopt_entry_label()
Definition: maglev-ir.h:1841
Definition: maglev-ir.h:11408
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Deopt(uint64_t bitfield, DeoptimizeReason reason)
Definition: maglev-ir.h:11412
Definition: maglev-ir.h:1867
EagerDeoptInfo(Zone *zone, const DeoptFrame top_frame, compiler::FeedbackSource feedback_to_update)
Definition: maglev-ir.h:1869
DeoptimizeReason reason() const
Definition: maglev-ir.h:1873
void set_reason(DeoptimizeReason reason)
Definition: maglev-ir.h:1874
void ForEachInput(Function &&f)
Definition: maglev-deopt-frame-visitor.h:113
EnsureWritableFastElements(uint64_t bitfield)
Definition: maglev-ir.h:8353
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8369
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:8364
int MaxCallStackArgs() const
Definition: maglev-ir.h:8366
Input & elements_input()
Definition: maglev-ir.h:8363
Definition: maglev-ir.h:1980
ExceptionHandlerInfo(BasicBlockRef *catch_block_ref, int depth)
Definition: maglev-ir.h:1991
base::ThreadedList< ExceptionHandlerInfo > List
Definition: maglev-ir.h:1982
int pc_offset() const
Definition: maglev-ir.h:2016
ExceptionHandlerInfo(BasicBlock *catch_block_ref, int depth)
Definition: maglev-ir.h:1997
BasicBlock * catch_block() const
Definition: maglev-ir.h:2008
Label & trampoline_entry()
Definition: maglev-ir.h:2004
Mode
Definition: maglev-ir.h:1983
@ kNoExceptionHandler
Definition: maglev-ir.h:1984
@ kLazyDeopt
Definition: maglev-ir.h:1985
bool ShouldLazyDeopt() const
Definition: maglev-ir.h:2002
bool HasExceptionHandler() const
Definition: maglev-ir.h:2000
BasicBlockRef * catch_block_ref_address()
Definition: maglev-ir.h:2006
void set_pc_offset(int offset)
Definition: maglev-ir.h:2017
int depth() const
Definition: maglev-ir.h:2010
ExceptionHandlerInfo(Mode mode=kNoExceptionHandler)
Definition: maglev-ir.h:1988
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int MaxCallStackArgs() const
Definition: maglev-ir.h:8393
int old_length() const
Definition: maglev-ir.h:8398
Input & object_input()
Definition: maglev-ir.h:8391
Input & property_array_input()
Definition: maglev-ir.h:8390
ExtendPropertiesBackingStore(uint64_t bitfield, int old_length)
Definition: maglev-ir.h:8377
Definition: maglev-ir.h:5564
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
ExternalReference reference() const
Definition: maglev-ir.h:5577
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ExternalConstant(uint64_t bitfield, const ExternalReference &reference)
Definition: maglev-ir.h:5570
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:5579
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:884
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5574
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7539
Definition: maglev-ir.h:6636
FastCreateClosure(uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info, compiler::FeedbackCellRef feedback_cell)
Definition: maglev-ir.h:6640
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::SharedFunctionInfoRef shared_function_info() const
Definition: maglev-ir.h:6647
Input & context()
Definition: maglev-ir.h:6652
compiler::FeedbackCellRef feedback_cell() const
Definition: maglev-ir.h:6650
Definition: maglev-ir.h:2978
detail::YouNeedToDefineAnInputTypesArrayInYourDerivedClass kInputTypes
Definition: maglev-ir.h:3018
constexpr bool has_inputs() const
Definition: maglev-ir.h:2983
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition: maglev-ir.h:2989
FixedInputNodeTMixin(uint64_t bitfield, Args &&... args)
Definition: maglev-ir.h:3021
static constexpr size_t kInputCount
Definition: maglev-ir.h:2980
constexpr auto end()
Definition: maglev-ir.h:2985
detail::ArrayWrapper< kInputCount > InputTypes
Definition: maglev-ir.h:3017
constexpr uint16_t input_count() const
Definition: maglev-ir.h:2984
Definition: maglev-ir.h:4420
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:642
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4434
Input & input()
Definition: maglev-ir.h:4430
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4426
Float64Abs(uint64_t bitfield)
Definition: maglev-ir.h:4424
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4428
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3433
Input & right_input()
Definition: maglev-ir.h:3441
static constexpr int kRightIndex
Definition: maglev-ir.h:3439
Input & left_input()
Definition: maglev-ir.h:3440
static constexpr int kLeftIndex
Definition: maglev-ir.h:3438
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3446
Float64BinaryNodeWithCall(uint64_t bitfield)
Definition: maglev-ir.h:3444
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3435
Definition: maglev-ir.h:3397
static constexpr int kRightIndex
Definition: maglev-ir.h:3406
Input & right_input()
Definition: maglev-ir.h:3408
Float64BinaryNode(uint64_t bitfield)
Definition: maglev-ir.h:3411
Input & left_input()
Definition: maglev-ir.h:3407
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3401
static constexpr int kLeftIndex
Definition: maglev-ir.h:3405
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3402
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3413
Definition: maglev-ir.h:3472
Float64Compare(uint64_t bitfield, Operation operation)
Definition: maglev-ir.h:3476
static constexpr int kRightIndex
Definition: maglev-ir.h:3483
void GenerateCode(MaglevAssembler *, const ProcessingState &)
constexpr Operation operation() const
Definition: maglev-ir.h:3487
static constexpr int kLeftIndex
Definition: maglev-ir.h:3482
Input & right_input()
Definition: maglev-ir.h:3485
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7966
Input & left_input()
Definition: maglev-ir.h:3484
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3479
auto options() const
Definition: maglev-ir.h:3495
Definition: maglev-ir.h:3944
Float64 value() const
Definition: maglev-ir.h:3955
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3953
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:3957
Float64Constant(uint64_t bitfield, Float64 value)
Definition: maglev-ir.h:3950
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:908
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7569
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Float64CountLeadingZeros(uint64_t bitfield)
Definition: maglev-ir.h:4481
Input & input()
Definition: maglev-ir.h:4487
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4484
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4491
static Builtin continuation()
Definition: maglev-ir.h:4479
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4485
Definition: maglev-ir.h:3563
Ieee754Function
Definition: maglev-ir.h:3567
ExternalReference ieee_function_ref() const
Definition: maglev-ir.cc:503
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3578
void SetValueLocationConstraints()
Definition: maglev-ir-arm.cc:698
Input & input()
Definition: maglev-ir.h:3580
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7997
Ieee754Function ieee_function() const
Definition: maglev-ir.h:3589
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:702
Float64Ieee754Unary(uint64_t bitfield, Ieee754Function ieee_function)
Definition: maglev-ir.h:3572
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3575
int MaxCallStackArgs() const
Definition: maglev-ir-arm.cc:697
auto options() const
Definition: maglev-ir.h:3587
Definition: maglev-ir.h:3525
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3533
void SetValueLocationConstraints()
Definition: maglev-ir-arm.cc:631
Float64Negate(uint64_t bitfield)
Definition: maglev-ir.h:3529
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3539
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:635
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3531
Input & input()
Definition: maglev-ir.h:3535
Definition: maglev-ir.h:4494
Float64Round(uint64_t bitfield, Kind kind)
Definition: maglev-ir.h:4511
Input & input()
Definition: maglev-ir.h:4517
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:8009
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4515
Kind kind() const
Definition: maglev-ir.h:4518
auto options() const
Definition: maglev-ir.h:4524
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4513
static Builtin continuation(Kind kind)
Definition: maglev-ir.h:4500
Kind
Definition: maglev-ir.h:4498
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:649
Definition: maglev-ir.h:3501
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7971
Input & value()
Definition: maglev-ir.h:3511
auto options() const
Definition: maglev-ir.h:3519
constexpr bool flip() const
Definition: maglev-ir.h:3513
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Float64ToBoolean(uint64_t bitfield, bool flip)
Definition: maglev-ir.h:3505
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3508
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4150
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4152
int MaxCallStackArgs() const
Definition: maglev-ir.h:4158
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4161
Input & input()
Definition: maglev-ir.h:4156
Float64ToHeapNumberForField(uint64_t bitfield)
Definition: maglev-ir.h:4148
Definition: maglev-ir.h:4105
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4113
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4124
Float64ToTagged(uint64_t bitfield, ConversionMode mode)
Definition: maglev-ir.h:4110
ConversionMode conversion_mode() const
Definition: maglev-ir.h:4128
Input & input()
Definition: maglev-ir.h:4119
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4115
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ConversionMode
Definition: maglev-ir.h:4109
int MaxCallStackArgs() const
Definition: maglev-ir.h:4121
auto options() const
Definition: maglev-ir.h:4126
Input & input()
Definition: maglev-ir.h:4019
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4015
Float64ToUint8Clamped(uint64_t bitfield)
Definition: maglev-ir.h:4013
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4023
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4017
Definition: maglev-ir.h:5298
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & cache_index()
Definition: maglev-ir.h:5317
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:5311
Input & receiver()
Definition: maglev-ir.h:5314
ForInNext(uint64_t bitfield, compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:5302
Input & cache_type()
Definition: maglev-ir.h:5316
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5322
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5305
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5306
Input & context()
Definition: maglev-ir.h:5313
Input & cache_array()
Definition: maglev-ir.h:5315
Definition: maglev-ir.h:5270
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5279
int ReturnCount() const
Definition: maglev-ir.h:5287
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:5282
Input & enumerator()
Definition: maglev-ir.h:5285
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5292
Input & context()
Definition: maglev-ir.h:5284
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5277
ForInPrepare(uint64_t bitfield, compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:5274
FunctionEntryStackCheck(uint64_t bitfield)
Definition: maglev-ir.h:7583
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7596
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:9770
compiler::AllocatedOperand target() const
Definition: maglev-ir.h:9779
GapMove(uint64_t bitfield, compiler::AllocatedOperand source, compiler::AllocatedOperand target)
Definition: maglev-ir.h:9774
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::AllocatedOperand source() const
Definition: maglev-ir.h:9778
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5459
void GenerateCode(MaglevAssembler *, const ProcessingState &)
GeneratorRestoreRegister(uint64_t bitfield, int index)
Definition: maglev-ir.h:5455
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5458
Input & array_input()
Definition: maglev-ir.h:5462
Input & stale_input()
Definition: maglev-ir.h:5463
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5468
int index() const
Definition: maglev-ir.h:5464
Definition: maglev-ir.h:5177
static constexpr int kGeneratorIndex
Definition: maglev-ir.h:5183
static constexpr int kFixedInputCount
Definition: maglev-ir.h:5184
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5197
int suspend_id() const
Definition: maglev-ir.h:5201
Input & generator_input()
Definition: maglev-ir.h:5205
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5226
void GenerateCode(MaglevAssembler *, const ProcessingState &)
GeneratorStore(uint64_t bitfield, ValueNode *context, ValueNode *generator, int suspend_id, int bytecode_offset)
Definition: maglev-ir.h:5188
int num_parameters_and_registers() const
Definition: maglev-ir.h:5207
Input & context_input()
Definition: maglev-ir.h:5204
void set_parameters_and_registers(int i, ValueNode *node)
Definition: maglev-ir.h:5211
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition: maglev-ir.cc:571
static constexpr int kContextIndex
Definition: maglev-ir.h:5182
int bytecode_offset() const
Definition: maglev-ir.h:5202
Input & parameters_and_registers(int i)
Definition: maglev-ir.h:5210
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11179
GetContinuationPreservedEmbedderData(uint64_t bitfield)
Definition: maglev-ir.h:11174
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:5328
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5353
Input & receiver()
Definition: maglev-ir.h:5344
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5340
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5339
int load_slot() const
Definition: maglev-ir.h:5346
int call_slot() const
Definition: maglev-ir.h:5347
Input & context()
Definition: maglev-ir.h:5343
IndirectHandle< FeedbackVector > feedback() const
Definition: maglev-ir.h:5348
GetIterator(uint64_t bitfield, int load_slot, int call_slot, compiler::FeedbackVectorRef feedback)
Definition: maglev-ir.h:5332
Definition: maglev-ir.h:9666
Input & context()
Definition: maglev-ir.h:9685
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:9686
Input & key_input()
Definition: maglev-ir.h:9687
GetKeyedGeneric(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9670
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9692
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9680
GetSecondReturnedValue(uint64_t bitfield)
Definition: maglev-ir.h:5370
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5369
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5374
Definition: maglev-ir.h:7657
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7684
GetTemplateObject(uint64_t bitfield, compiler::SharedFunctionInfoRef shared_function_info, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:7661
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:7679
compiler::SharedFunctionInfoRef shared_function_info()
Definition: maglev-ir.h:7676
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & description()
Definition: maglev-ir.h:7674
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:10919
HandleNoHeapWritesInterrupt(uint64_t bitfield)
Definition: maglev-ir.h:10911
int MaxCallStackArgs() const
Definition: maglev-ir.h:10920
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void SetValueLocationConstraints()
Definition: maglev-ir.h:10917
Definition: maglev-ir.h:7692
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object()
Definition: maglev-ir.h:7707
HasInPrototypeChain(uint64_t bitfield, compiler::HeapObjectRef prototype)
Definition: maglev-ir.h:7696
compiler::HeapObjectRef prototype()
Definition: maglev-ir.h:7709
Definition: maglev-ir.h:4790
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4797
HoleyFloat64IsHole(uint64_t bitfield)
Definition: maglev-ir.h:4794
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4803
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & input()
Definition: maglev-ir.h:4799
void SetValueLocationConstraints()
Definition: maglev-ir-arm.cc:765
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:769
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4747
Input & input()
Definition: maglev-ir.h:4742
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4740
int MaxCallStackArgs() const
Definition: maglev-ir.h:4744
HoleyFloat64ToMaybeNanFloat64(uint64_t bitfield)
Definition: maglev-ir.h:4736
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4738
Definition: maglev-ir.h:4165
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4175
ConversionMode conversion_mode() const
Definition: maglev-ir.h:4192
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4173
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4184
void SetMode(ConversionMode mode)
Definition: maglev-ir.h:4186
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ConversionMode
Definition: maglev-ir.h:4169
HoleyFloat64ToTagged(uint64_t bitfield, ConversionMode mode)
Definition: maglev-ir.h:4170
int MaxCallStackArgs() const
Definition: maglev-ir.h:4181
auto options() const
Definition: maglev-ir.h:4190
Input & input()
Definition: maglev-ir.h:4179
Definition: maglev-ir.h:3047
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3067
Identity(uint64_t bitfield)
Definition: maglev-ir.h:3053
void SetValueLocationConstraints()
Definition: maglev-ir.h:3065
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:3066
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3051
void VerifyInputs(MaglevGraphLabeller *) const
Definition: maglev-ir.h:3055
Definition: maglev-ir.h:5474
interpreter::Register source() const
Definition: maglev-ir.h:5480
static uint32_t stack_slot(uint32_t register_idx)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
auto options() const
Definition: maglev-ir.h:5488
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7602
InitialValue(uint64_t bitfield, interpreter::Register source)
Definition: maglev-ir.cc:167
Definition: maglev-ir.h:6276
static constexpr OpProperties kProperties
Definition: maglev-ir.h:6290
void SetElided()
Definition: maglev-ir.h:6328
void VerifyInputs(MaglevGraphLabeller *graph_labeller) const
Definition: maglev-ir.cc:820
void ForceEscaping()
Definition: maglev-ir.h:6323
int non_escaping_use_count() const
Definition: maglev-ir.h:6310
bool HasBeenElided() const
Definition: maglev-ir.h:6337
void UpdateObject(VirtualObject *object)
Definition: maglev-ir.h:6350
void SetEscaped()
Definition: maglev-ir.h:6332
size_t size() const
Definition: maglev-ir.h:6300
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:132
AllocationBlock * allocation_block()
Definition: maglev-ir.cc:827
bool HasEscaped() const
Definition: maglev-ir.h:6342
InlinedAllocation(uint64_t bitfield, VirtualObject *object)
Definition: maglev-ir.h:6282
void SetValueLocationConstraints()
Definition: maglev-ir-arm.cc:123
bool IsEscaping() const
Definition: maglev-ir.h:6319
void AddNonEscapingUses(int n=1)
Definition: maglev-ir.h:6315
void RemoveNonEscapingUses(int n=1)
Definition: maglev-ir.h:6312
VirtualObject * object() const
Definition: maglev-ir.h:6302
bool HasBeenAnalysed() const
Definition: maglev-ir.h:6346
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:6292
void set_offset(int offset)
Definition: maglev-ir.h:6308
Input & allocation_block_input()
Definition: maglev-ir.h:6287
int offset() const
Definition: maglev-ir.h:6304
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7653
base::ThreadedList< InlinedAllocation > List
Definition: maglev-ir.h:6280
ValueNode * closure() const
Definition: maglev-ir.h:1649
BytecodeOffset bytecode_position() const
Definition: maglev-ir.h:1647
const MaglevCompilationUnit & unit() const
Definition: maglev-ir.h:1646
InlinedArgumentsDeoptFrame(const MaglevCompilationUnit &unit, BytecodeOffset bytecode_position, ValueNode *closure, base::Vector< ValueNode * > arguments, DeoptFrame *parent)
Definition: maglev-ir.h:1637
base::Vector< ValueNode * > arguments() const
Definition: maglev-ir.h:1650
ValueNode *& closure()
Definition: maglev-ir.h:1648
Definition: maglev-ir.h:1485
NodeIdT * get_next_use_id_address()
Definition: maglev-ir.h:1489
NodeIdT next_use_id() const
Definition: maglev-ir.h:1487
Definition: maglev-ir.h:1495
void set_node(ValueNode *node)
Definition: maglev-ir.h:1499
void clear()
Definition: maglev-ir.cc:379
Input(ValueNode *node)
Definition: maglev-ir.h:1497
ValueNode * node() const
Definition: maglev-ir.h:1498
Definition: maglev-ir.h:4401
Int32AbsWithOverflow(uint64_t bitfield)
Definition: maglev-ir.h:4413
Input & input()
Definition: maglev-ir.h:4411
static constexpr int kValueIndex
Definition: maglev-ir.h:4410
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4417
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:42
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4405
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4408
Definition: maglev-ir.h:3191
static constexpr int kRightIndex
Definition: maglev-ir.h:3200
Input & left_input()
Definition: maglev-ir.h:3201
static constexpr int kLeftIndex
Definition: maglev-ir.h:3199
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3195
Int32BinaryNode(uint64_t bitfield)
Definition: maglev-ir.h:3205
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3196
Input & right_input()
Definition: maglev-ir.h:3202
Int32BinaryWithOverflowNode(uint64_t bitfield)
Definition: maglev-ir.h:3164
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3155
static constexpr int kRightIndex
Definition: maglev-ir.h:3159
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3166
static constexpr int kLeftIndex
Definition: maglev-ir.h:3158
Input & right_input()
Definition: maglev-ir.h:3161
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3153
Input & left_input()
Definition: maglev-ir.h:3160
Definition: maglev-ir.h:3217
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3225
Int32BitwiseNot(uint64_t bitfield)
Definition: maglev-ir.h:3221
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir-arm.cc:551
static constexpr int kValueIndex
Definition: maglev-ir.h:3227
void SetValueLocationConstraints()
Definition: maglev-ir-arm.cc:546
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3223
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3232
Input & value_input()
Definition: maglev-ir.h:3228
Definition: maglev-ir.h:3283
static constexpr int kLeftIndex
Definition: maglev-ir.h:3293
constexpr Operation operation() const
Definition: maglev-ir.h:3298
auto options() const
Definition: maglev-ir.h:3306
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7978
Int32Compare(uint64_t bitfield, Operation operation)
Definition: maglev-ir.h:3287
Input & left_input()
Definition: maglev-ir.h:3295
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3290
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr int kRightIndex
Definition: maglev-ir.h:3294
Input & right_input()
Definition: maglev-ir.h:3296
Definition: maglev-ir.h:3866
void GenerateCode(MaglevAssembler *, const ProcessingState &)
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:3879
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3875
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7554
int32_t value() const
Definition: maglev-ir.h:3877
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:896
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
Int32Constant(uint64_t bitfield, int32_t value)
Definition: maglev-ir.h:3872
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4452
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4444
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4446
Int32CountLeadingZeros(uint64_t bitfield)
Definition: maglev-ir.h:4442
Input & input()
Definition: maglev-ir.h:4448
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3270
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3269
Int32ShiftRightLogical(uint64_t bitfield)
Definition: maglev-ir.h:3266
Input & left_input()
Definition: maglev-ir.h:3275
static constexpr int kRightIndex
Definition: maglev-ir.h:3274
Input & right_input()
Definition: maglev-ir.h:3276
static constexpr int kLeftIndex
Definition: maglev-ir.h:3273
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3280
Definition: maglev-ir.h:3312
Input & value()
Definition: maglev-ir.h:3321
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3319
constexpr bool flip() const
Definition: maglev-ir.h:3323
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7983
Int32ToBoolean(uint64_t bitfield, bool flip)
Definition: maglev-ir.h:3316
auto options() const
Definition: maglev-ir.h:3329
Definition: maglev-ir.h:4045
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4062
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & input()
Definition: maglev-ir.h:4057
int MaxCallStackArgs() const
Definition: maglev-ir.h:4059
Int32ToNumber(uint64_t bitfield)
Definition: maglev-ir.h:4049
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4055
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4051
Definition: maglev-ir.h:3973
Int32ToUint8Clamped(uint64_t bitfield)
Definition: maglev-ir.h:3977
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3979
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & input()
Definition: maglev-ir.h:3983
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3981
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3987
static constexpr int kValueIndex
Definition: maglev-ir.h:3245
Int32UnaryWithOverflowNode(uint64_t bitfield)
Definition: maglev-ir.h:3249
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3240
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3243
Input & value_input()
Definition: maglev-ir.h:3246
Definition: maglev-ir.h:3918
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:904
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:3931
IntPtrConstant(uint64_t bitfield, intptr_t value)
Definition: maglev-ir.h:3924
intptr_t value() const
Definition: maglev-ir.h:3929
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7564
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3927
Definition: maglev-ir.h:3335
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3342
constexpr bool flip() const
Definition: maglev-ir.h:3346
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7990
IntPtrToBoolean(uint64_t bitfield, bool flip)
Definition: maglev-ir.h:3339
Input & value()
Definition: maglev-ir.h:3344
auto options() const
Definition: maglev-ir.h:3352
Definition: maglev-ir.h:4085
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4091
Input & input()
Definition: maglev-ir.h:4097
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4102
IntPtrToNumber(uint64_t bitfield)
Definition: maglev-ir.h:4089
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int MaxCallStackArgs() const
Definition: maglev-ir.h:4099
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4095
int ComputeReturnOffset(interpreter::Register result_location, int result_size) const
Definition: maglev-ir.cc:413
const MaglevCompilationUnit & unit() const
Definition: maglev-ir.h:1604
InterpretedDeoptFrame(const MaglevCompilationUnit &unit, const CompactInterpreterFrameState *frame_state, ValueNode *closure, BytecodeOffset bytecode_position, SourcePosition source_position, DeoptFrame *parent)
Definition: maglev-ir.h:1596
BytecodeOffset bytecode_position() const
Definition: maglev-ir.h:1610
ValueNode * closure() const
Definition: maglev-ir.h:1609
ValueNode *& closure()
Definition: maglev-ir.h:1608
SourcePosition source_position() const
Definition: maglev-ir.h:1611
const CompactInterpreterFrameState * frame_state() const
Definition: maglev-ir.h:1605
Definition: maglev-ir.h:11345
void GenerateCode(MaglevAssembler *, const ProcessingState &)
JumpLoop(uint64_t bitfield, BasicBlock *target)
Definition: maglev-ir.h:11349
base::Vector< Input > used_nodes()
Definition: maglev-ir.h:11359
void set_used_nodes(base::Vector< Input > locations)
Definition: maglev-ir.h:11360
JumpLoop(uint64_t bitfield, BasicBlockRef *ref)
Definition: maglev-ir.h:11352
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11357
Definition: maglev-ir.h:11317
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11326
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Jump(uint64_t bitfield, BasicBlockRef *target_refs)
Definition: maglev-ir.h:11321
Definition: maglev-ir.h:1885
interpreter::Register result_location() const
Definition: maglev-ir.h:1896
bool HasResultLocation() const
Definition: maglev-ir.h:1906
static bool InReturnValues(interpreter::Register reg, interpreter::Register result_location, int result_size)
Definition: maglev-ir.cc:403
void set_deopting_call_return_pc(int pc)
Definition: maglev-ir.h:1919
int deopting_call_return_pc() const
Definition: maglev-ir.h:1914
void ForEachInput(Function &&f)
Definition: maglev-deopt-frame-visitor.h:123
bool IsResultRegister(interpreter::Register reg) const
Definition: maglev-ir.cc:388
int result_size() const
Definition: maglev-ir.h:1900
LazyDeoptInfo(Zone *zone, const DeoptFrame top_frame, interpreter::Register result_location, int result_size, compiler::FeedbackSource feedback_to_update)
Definition: maglev-ir.h:1887
const InterpretedDeoptFrame & GetFrameForExceptionHandler(const ExceptionHandlerInfo *handler_info)
Definition: maglev-ir.cc:436
LoadDoubleDataViewElement(uint64_t bitfield, ExternalArrayType type)
Definition: maglev-ir.h:8648
bool is_little_endian_constant()
Definition: maglev-ir.h:8666
Input & index_input()
Definition: maglev-ir.h:8663
Input & object_input()
Definition: maglev-ir.h:8662
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & is_little_endian_input()
Definition: maglev-ir.h:8664
auto options() const
Definition: maglev-ir.h:8674
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8672
Definition: maglev-ir.h:8215
int offset() const
Definition: maglev-ir.h:8227
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LoadDoubleField(uint64_t bitfield, int offset)
Definition: maglev-ir.h:8219
Input & object_input()
Definition: maglev-ir.h:8230
auto options() const
Definition: maglev-ir.h:8236
Definition: maglev-ir.h:9437
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LoadEnumCacheLength(uint64_t bitfield)
Definition: maglev-ir.h:9441
Input & map_input()
Definition: maglev-ir.h:9449
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9453
LoadFixedArrayElement(uint64_t bitfield)
Definition: maglev-ir.h:8332
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & index_input()
Definition: maglev-ir.h:8341
Input & elements_input()
Definition: maglev-ir.h:8340
Input & elements_input()
Definition: maglev-ir.h:8518
Input & index_input()
Definition: maglev-ir.h:8519
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8523
LoadFixedDoubleArrayElement(uint64_t bitfield)
Definition: maglev-ir.h:8509
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:8242
auto options() const
Definition: maglev-ir.h:8263
int offset() const
Definition: maglev-ir.h:8254
LoadFloat64(uint64_t bitfield, int offset)
Definition: maglev-ir.h:8246
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:8257
Definition: maglev-ir.h:9245
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LoadGlobal(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback, TypeofMode typeof_mode)
Definition: maglev-ir.h:9249
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9263
Input & context()
Definition: maglev-ir.h:9266
TypeofMode typeof_mode() const
Definition: maglev-ir.h:9264
compiler::NameRef name() const
Definition: maglev-ir.h:9262
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LoadHoleyFixedDoubleArrayElementCheckedNotHole(uint64_t bitfield)
Definition: maglev-ir.h:8556
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8572
LoadHoleyFixedDoubleArrayElement(uint64_t bitfield)
Definition: maglev-ir.h:8531
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8546
Input & index_input()
Definition: maglev-ir.h:8542
Input & elements_input()
Definition: maglev-ir.h:8541
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:8269
auto options() const
Definition: maglev-ir.h:8290
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:8284
LoadInt32(uint64_t bitfield, int offset)
Definition: maglev-ir.h:8273
int offset() const
Definition: maglev-ir.h:8281
compiler::NameRef name() const
Definition: maglev-ir.h:9382
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9383
Input & lookup_start_object()
Definition: maglev-ir.h:9390
Input & context()
Definition: maglev-ir.h:9388
LoadNamedFromSuperGeneric(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9372
Input & receiver()
Definition: maglev-ir.h:9389
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:9336
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::NameRef name() const
Definition: maglev-ir.h:9349
Input & context()
Definition: maglev-ir.h:9354
Input & object_input()
Definition: maglev-ir.h:9355
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9350
LoadNamedGeneric(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9340
LoadSignedIntDataViewElement(uint64_t bitfield, ExternalArrayType type)
Definition: maglev-ir.h:8604
ExternalArrayType type() const
Definition: maglev-ir.h:8635
auto options() const
Definition: maglev-ir.h:8633
Input & index_input()
Definition: maglev-ir.h:8622
Input & object_input()
Definition: maglev-ir.h:8621
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8631
Input & is_little_endian_input()
Definition: maglev-ir.h:8623
void GenerateCode(MaglevAssembler *, const ProcessingState &)
bool is_little_endian_constant()
Definition: maglev-ir.h:8625
Input & object_input()
Definition: maglev-ir.h:8311
LoadTaggedFieldByFieldIndex(uint64_t bitfield)
Definition: maglev-ir.h:8301
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8324
int MaxCallStackArgs() const
Definition: maglev-ir.h:8321
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & index_input()
Definition: maglev-ir.h:8312
LoadTaggedFieldForContextSlotNoCells(uint64_t bitfield, const int offset)
Definition: maglev-ir.h:8177
Input & context()
Definition: maglev-ir.h:8200
int MaxCallStackArgs() const
Definition: maglev-ir.h:8202
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int offset() const
Definition: maglev-ir.h:8196
auto options() const
Definition: maglev-ir.h:8207
LoadTaggedFieldForContextSlot(uint64_t bitfield, const int offset)
Definition: maglev-ir.h:8187
LoadTaggedFieldForProperty(uint64_t bitfield, const int offset, compiler::NameRef name)
Definition: maglev-ir.h:8161
compiler::NameRef name()
Definition: maglev-ir.h:8164
auto options() const
Definition: maglev-ir.h:8166
Definition: maglev-ir.h:8148
LoadTaggedField(uint64_t bitfield, const int offset)
Definition: maglev-ir.h:8152
Definition: maglev-ir.h:7450
auto options() const
Definition: maglev-ir.h:7468
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7466
Input & receiver_input()
Definition: maglev-ir.h:7462
ElementsKind elements_kind() const
Definition: maglev-ir.h:7470
LoadTypedArrayLength(uint64_t bitfield, ElementsKind elements_kind)
Definition: maglev-ir.h:7454
Definition: maglev-ir.h:4869
Input & value()
Definition: maglev-ir.h:4878
void GenerateCode(MaglevAssembler *, const ProcessingState &)
LogicalNot(uint64_t bitfield)
Definition: maglev-ir.h:4873
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4882
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4876
Definition: maglev-assembler.h:96
Definition: maglev-compilation-unit.h:23
compiler::SharedFunctionInfoRef shared_function_info() const
Definition: maglev-compilation-unit.h:71
compiler::BytecodeArrayRef bytecode() const
Definition: maglev-compilation-unit.h:74
Definition: maglev-graph-labeller.h:18
MapPrototypeGetInt32Key(uint64_t bitfield)
Definition: maglev-ir.h:7833
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7846
Input & table_input()
Definition: maglev-ir.h:7841
Input & key_input()
Definition: maglev-ir.h:7842
Definition: maglev-ir.h:7803
Input & table_input()
Definition: maglev-ir.h:7815
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & key_input()
Definition: maglev-ir.h:7816
int MaxCallStackArgs() const
Definition: maglev-ir.h:7818
MapPrototypeGet(uint64_t bitfield)
Definition: maglev-ir.h:7807
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7825
Input & index_input()
Definition: maglev-ir.h:8425
Input & object_input()
Definition: maglev-ir.h:8424
MaybeGrowFastElements(uint64_t bitfield, ElementsKind elements_kind)
Definition: maglev-ir.h:8409
Input & elements_length_input()
Definition: maglev-ir.h:8426
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8433
ElementsKind elements_kind() const
Definition: maglev-ir.h:8428
auto options() const
Definition: maglev-ir.h:8435
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int MaxCallStackArgs() const
Definition: maglev-ir.h:8430
Input & elements_input()
Definition: maglev-ir.h:8423
Definition: maglev-interpreter-frame-state.h:777
Definition: maglev-ir.h:7370
MigrateMapIfNeeded(uint64_t bitfield)
Definition: maglev-ir.h:7374
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7393
Input & map_input()
Definition: maglev-ir.h:7388
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:7387
Definition: maglev-ir.h:2083
Input * last_input()
Definition: maglev-ir.h:2357
void set_properties(OpProperties properties)
Definition: maglev-ir.h:2144
void Print() const
Definition: maglev-ir.cc:461
void set_temporaries_needed(uint8_t value)
Definition: maglev-ir.h:2381
static constexpr OpProperties kProperties
Definition: maglev-ir.h:2137
void set_owner(BasicBlock *block)
Definition: maglev-ir.h:2327
constexpr auto begin()
Definition: maglev-ir.h:2193
void RequireSpecificTemporary(Register reg)
Definition: maglev-ir.h:2393
void OverwriteWithIdentityTo(ValueNode *node)
Definition: maglev-ir-inl.h:139
constexpr uint64_t bitfield() const
Definition: maglev-ir.h:2337
void change_representation(ValueRepresentation new_repr)
Definition: maglev-ir.h:2277
InputCountField::Next< bool, 1 > ReservedField
Definition: maglev-ir.h:2098
constexpr bool Is() const
Definition: maglev-ir.h:2552
RegList & general_temporaries()
Definition: maglev-ir.h:2222
const Input * last_input() const
Definition: maglev-ir.h:2358
void set_input(int index, ValueNode *node)
Definition: maglev-ir.h:2906
static constexpr int kMaxInputs
Definition: maglev-ir.h:2103
DoubleRegList & double_temporaries()
Definition: maglev-ir.h:2223
Address last_input_address() const
Definition: maglev-ir.h:2360
static constexpr Opcode opcode_of
Definition: maglev-ir.h:2107
constexpr const Input & input(int index) const
Definition: maglev-ir.h:2183
constexpr Input * input_base()
Definition: maglev-ir.h:2351
InputAllocationPolicy
Definition: maglev-ir.h:2230
constexpr bool has_inputs() const
Definition: maglev-ir.h:2173
RegListBase< RegisterT > & temporaries()
Definition: maglev-ir.h:2219
void set_id(NodeIdT id)
Definition: maglev-ir.h:2203
void assign_temporaries(RegListBase< RegisterT > list)
Definition: maglev-ir.h:2226
constexpr const T * Cast() const
Definition: maglev-ir.h:2159
void reduce_input_count(int num=1)
Definition: maglev-ir.h:2369
void InitTemporaries()
Definition: maglev-ir.h:2331
void ForAllInputsInRegallocAssignmentOrder(Function &&f)
Definition: maglev-ir.h:11852
constexpr const Input * input_base() const
Definition: maglev-ir.h:2354
void CopyEagerDeoptInfoOf(NodeBase *other, Zone *zone)
Definition: maglev-ir.h:2287
constexpr NodeIdT id() const
Definition: maglev-ir.h:2199
constexpr T * TryCast()
Definition: maglev-ir.h:2164
void ClearUnstableNodeAspects(KnownNodeAspects &)
Definition: maglev-ir.cc:8152
NodeBase(uint64_t bitfield)
Definition: maglev-ir.h:2334
void SetEagerDeoptInfo(Zone *zone, DeoptFrame deopt_frame, compiler::FeedbackSource feedback_to_update=compiler::FeedbackSource())
Definition: maglev-ir.h:2293
void change_input(int index, ValueNode *node)
Definition: maglev-ir-inl.h:113
static Derived * New(Zone *zone, std::initializer_list< ValueNode * > inputs, Args &&... args)
Definition: maglev-ir.h:2110
void ClearElementsProperties(KnownNodeAspects &)
Definition: maglev-ir.cc:8139
const RegisterSnapshot & register_snapshot() const
Definition: maglev-ir.h:2259
void set_bitfield(uint64_t new_bitfield)
Definition: maglev-ir.h:2338
constexpr int input_count() const
Definition: maglev-ir.h:2174
constexpr Input & input(int index)
Definition: maglev-ir.h:2179
void set_opcode(Opcode new_opcode)
Definition: maglev-ir.h:2283
uint8_t num_temporaries_needed() const
Definition: maglev-ir.h:2210
constexpr const T * TryCast() const
Definition: maglev-ir.h:2169
constexpr T * Cast()
Definition: maglev-ir.h:2154
void set_double_temporaries_needed(uint8_t value)
Definition: maglev-ir.h:2386
void RequireSpecificDoubleTemporary(DoubleRegister reg)
Definition: maglev-ir.h:2397
constexpr bool has_id() const
Definition: maglev-ir.h:2198
auto options() const
Definition: maglev-ir.h:2322
void set_register_snapshot(RegisterSnapshot snapshot)
Definition: maglev-ir.h:2269
void initialize_input_null(int index)
Definition: maglev-ir.h:2900
LazyDeoptInfo * lazy_deopt_info()
Definition: maglev-ir.h:2253
std::optional< int32_t > TryGetInt32ConstantInput(int index)
Definition: maglev-ir.cc:8212
constexpr Opcode opcode() const
Definition: maglev-ir.h:2140
constexpr auto end()
Definition: maglev-ir.h:2194
void OverwriteWith(Opcode new_opcode, std::optional< OpProperties > maybe_new_properties=std::nullopt)
Definition: maglev-ir.h:2307
EagerDeoptInfo * eager_deopt_info()
Definition: maglev-ir.h:2246
void OverwriteWith()
Definition: maglev-ir.h:2303
BasicBlock * owner() const
Definition: maglev-ir.h:2329
ExceptionHandlerInfo * exception_handler_info()
Definition: maglev-ir.h:2264
constexpr OpProperties properties() const
Definition: maglev-ir.h:2141
static Derived * New(Zone *zone, size_t input_count, Args &&... args)
Definition: maglev-ir.h:2130
Definition: maglev-ir.h:2933
static Derived * New(Zone *zone, std::initializer_list< ValueNode * > inputs, Args &&... args)
Definition: maglev-ir.h:2942
NodeTMixin(uint64_t bitfield, Args &&... args)
Definition: maglev-ir.h:2953
constexpr const OpProperties & properties() const
Definition: maglev-ir.h:2937
static Derived * New(Zone *zone, size_t input_count, Args &&... args)
Definition: maglev-ir.h:2947
constexpr Opcode opcode() const
Definition: maglev-ir.h:2936
Definition: maglev-ir.h:2587
ValueLocation & result()
Definition: maglev-ir.h:2925
static constexpr bool needs_epoch_check(Opcode op)
Definition: maglev-ir.h:2599
static constexpr bool participate_in_cse(Opcode op)
Definition: maglev-ir.h:2591
Definition: maglev-ir.h:5430
Input & value_input()
Definition: maglev-ir.h:5442
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5440
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int MaxCallStackArgs() const
Definition: maglev-ir.h:5444
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5436
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5447
NumberToString(uint64_t bitfield)
Definition: maglev-ir.h:5434
Definition: maglev-ir.h:1207
static const size_t kSize
Definition: maglev-ir.h:1416
static constexpr OpProperties TaggedValue()
Definition: maglev-ir.h:1312
constexpr bool can_allocate() const
Definition: maglev-ir.h:1237
static constexpr OpProperties ConversionNode()
Definition: maglev-ir.h:1348
constexpr bool needs_register_snapshot() const
Definition: maglev-ir.h:1256
constexpr bool is_required_when_unused() const
Definition: maglev-ir.h:1262
constexpr bool can_read() const
Definition: maglev-ir.h:1235
static constexpr OpProperties CanCallUserCode()
Definition: maglev-ir.h:1351
constexpr OpProperties(uint32_t bitfield)
Definition: maglev-ir.h:1373
static constexpr OpProperties CanThrow()
Definition: maglev-ir.h:1296
static constexpr OpProperties IntPtr()
Definition: maglev-ir.h:1336
constexpr bool can_throw() const
Definition: maglev-ir.h:1230
static constexpr OpProperties CanRead()
Definition: maglev-ir.h:1300
static constexpr OpProperties DeferredCall()
Definition: maglev-ir.h:1366
static constexpr OpProperties CanAllocate()
Definition: maglev-ir.h:1306
constexpr bool is_deopt_checkpoint() const
Definition: maglev-ir.h:1223
static constexpr OpProperties Int32()
Definition: maglev-ir.h:1320
constexpr bool can_eager_deopt() const
Definition: maglev-ir.h:1215
static constexpr OpProperties AnySideEffects()
Definition: maglev-ir.h:1363
constexpr OpProperties operator|(const OpProperties &that)
Definition: maglev-ir.h:1276
OpProperties WithNewValueRepresentation(ValueRepresentation new_repr) const
Definition: maglev-ir.h:1376
constexpr bool can_lazy_deopt() const
Definition: maglev-ir.h:1219
static constexpr OpProperties Call()
Definition: maglev-ir.h:1281
static constexpr OpProperties JSCall()
Definition: maglev-ir.h:1362
static constexpr OpProperties Uint32()
Definition: maglev-ir.h:1324
OpProperties WithoutDeopt() const
Definition: maglev-ir.h:1380
static constexpr OpProperties LazyDeopt()
Definition: maglev-ir.h:1288
static constexpr OpProperties Pure()
Definition: maglev-ir.h:1280
static constexpr OpProperties CanWrite()
Definition: maglev-ir.h:1303
constexpr bool is_any_call() const
Definition: maglev-ir.h:1214
constexpr ValueRepresentation value_representation() const
Definition: maglev-ir.h:1247
constexpr bool is_conversion() const
Definition: maglev-ir.h:1253
constexpr bool is_call() const
Definition: maglev-ir.h:1209
static constexpr OpProperties DeoptCheckpoint()
Definition: maglev-ir.h:1292
static constexpr OpProperties Float64()
Definition: maglev-ir.h:1328
static constexpr OpProperties ForValueRepresentation(ValueRepresentation repr)
Definition: maglev-ir.h:1344
constexpr bool is_deferred_call() const
Definition: maglev-ir.h:1418
constexpr bool is_pure() const
Definition: maglev-ir.h:1259
constexpr bool is_tagged() const
Definition: maglev-ir.h:1250
static constexpr OpProperties ExternalReference()
Definition: maglev-ir.h:1316
constexpr bool not_idempotent() const
Definition: maglev-ir.h:1244
static constexpr OpProperties GenericRuntimeOrBuiltinCall()
Definition: maglev-ir.h:1359
constexpr bool can_write() const
Definition: maglev-ir.h:1236
static constexpr OpProperties EagerDeopt()
Definition: maglev-ir.h:1284
static constexpr OpProperties NotIdempotent()
Definition: maglev-ir.h:1309
static constexpr OpProperties HoleyFloat64()
Definition: maglev-ir.h:1332
constexpr bool can_participate_in_cse() const
Definition: maglev-ir.h:1272
static constexpr OpProperties TrustedPointer()
Definition: maglev-ir.h:1340
constexpr bool can_deopt() const
Definition: maglev-ir.h:1227
Definition: maglev-ir.h:9852
UseRepresentationSet get_same_loop_uses_repr_hints()
Definition: maglev-ir.h:9910
NodeType type() const
Definition: maglev-ir.h:9939
NodeType type_
Definition: maglev-ir.h:9988
void merge_type(NodeType type)
Definition: maglev-ir.h:9931
Key key_
Definition: maglev-ir.h:10001
bool uses_require_31_bit_value() const
Definition: maglev-ir.h:9960
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & backedge_input()
Definition: maglev-ir.h:9869
const MergePointInterpreterFrameState * merge_state() const
Definition: maglev-ir.h:9872
void promote_post_loop_type()
Definition: maglev-ir.h:9924
bool is_backedge_offset(int i) const
Definition: maglev-ir.h:9883
Phi(uint64_t bitfield, MergePointInterpreterFrameState *merge_state, interpreter::Register owner)
Definition: maglev-ir.h:9859
void set_post_loop_type(NodeType type)
Definition: maglev-ir.h:9919
bool has_key() const
Definition: maglev-ir.h:9955
NodeType post_loop_type() const
Definition: maglev-ir.h:9914
void merge_post_loop_type(NodeType type)
Definition: maglev-ir.h:9915
bool is_exception_phi() const
Definition: maglev-ir.h:9880
void set_type(NodeType type)
Definition: maglev-ir.h:9935
void set_key(Key key)
Definition: maglev-ir.h:9949
UseRepresentationSet get_uses_repr_hints()
Definition: maglev-ir.h:9909
NodeType post_loop_type_
Definition: maglev-ir.h:9996
void set_uses_require_31_bit_value()
Definition: maglev-ir.h:9963
interpreter::Register owner() const
Definition: maglev-ir.h:9871
void RecordUseReprHint(UseRepresentation repr)
Definition: maglev-ir.h:9903
Key key() const
Definition: maglev-ir.h:9945
const FieldIndex field_index_
Definition: maglev-ir.h:8112
FieldIndex field_index() const
Definition: maglev-ir.h:8004
double constant_double() const
Definition: maglev-ir.h:7989
const compiler::ObjectRef constant_
Definition: maglev-ir.h:8108
static PolymorphicAccessInfo Constant(const ZoneVector< compiler::MapRef > &maps, compiler::ObjectRef constant)
Definition: maglev-ir.h:7955
static PolymorphicAccessInfo ConstantDouble(const ZoneVector< compiler::MapRef > &maps, Float64 constant)
Definition: maglev-ir.h:7960
compiler::OptionalJSObjectRef holder() const
Definition: maglev-ir.h:7999
static PolymorphicAccessInfo ModuleExport(const ZoneVector< compiler::MapRef > &maps, compiler::CellRef cell)
Definition: maglev-ir.h:7970
Representation field_representation() const
Definition: maglev-ir.h:8009
const compiler::OptionalJSObjectRef holder_
Definition: maglev-ir.h:8111
const Float64 constant_double_
Definition: maglev-ir.h:8109
Kind kind() const
Definition: maglev-ir.h:7980
static PolymorphicAccessInfo StringLength(const ZoneVector< compiler::MapRef > &maps)
Definition: maglev-ir.h:7975
DirectHandle< Cell > cell() const
Definition: maglev-ir.h:7994
struct v8::internal::maglev::PolymorphicAccessInfo::@103::@105 data_load_
static PolymorphicAccessInfo NotFound(const ZoneVector< compiler::MapRef > &maps)
Definition: maglev-ir.h:7951
DirectHandle< Object > constant() const
Definition: maglev-ir.h:7984
size_t hash_value() const
Definition: maglev-ir.h:8038
const ZoneVector< compiler::MapRef > & maps() const
Definition: maglev-ir.h:7982
bool operator==(const PolymorphicAccessInfo &other) const
Definition: maglev-ir.h:8011
@ kModuleExport
Definition: maglev-ir.h:7947
@ kConstant
Definition: maglev-ir.h:7944
@ kStringLength
Definition: maglev-ir.h:7948
@ kDataLoad
Definition: maglev-ir.h:7946
@ kNotFound
Definition: maglev-ir.h:7943
@ kConstantDouble
Definition: maglev-ir.h:7945
static PolymorphicAccessInfo DataLoad(const ZoneVector< compiler::MapRef > &maps, Representation representation, compiler::OptionalJSObjectRef holder, FieldIndex field_index)
Definition: maglev-ir.h:7964
Definition: maglev-graph-processor.h:66
int amount() const
Definition: maglev-ir.h:10940
ReduceInterruptBudgetForLoop(uint64_t bitfield, int amount)
Definition: maglev-ir.h:10928
Input & feedback_cell()
Definition: maglev-ir.h:10942
int amount() const
Definition: maglev-ir.h:10969
Input & feedback_cell()
Definition: maglev-ir.h:10971
ReduceInterruptBudgetForReturn(uint64_t bitfield, int amount)
Definition: maglev-ir.h:10958
Definition: maglev-ir.h:5494
Register input() const
Definition: maglev-ir.h:5501
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5503
void GenerateCode(MaglevAssembler *, const ProcessingState &)
RegisterInput(uint64_t bitfield, Register input)
Definition: maglev-ir.h:5498
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7617
Definition: maglev-ir.h:6517
RestLength(uint64_t bitfield, int formal_parameter_count)
Definition: maglev-ir.h:6521
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:6526
int formal_parameter_count() const
Definition: maglev-ir.h:6528
auto options() const
Definition: maglev-ir.h:6530
Definition: maglev-ir.h:11390
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11405
Return(uint64_t bitfield)
Definition: maglev-ir.h:11394
Input & value_input()
Definition: maglev-ir.h:11401
Definition: maglev-ir.h:5624
RootConstant(uint64_t bitfield, RootIndex index)
Definition: maglev-ir.h:5630
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7622
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.cc:353
RootIndex index() const
Definition: maglev-ir.h:5635
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Handle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:921
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
Definition: maglev-ir.h:9479
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & index_input()
Definition: maglev-ir.h:9492
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9496
SeqOneByteStringAt(uint64_t bitfield)
Definition: maglev-ir.h:9483
Input & string_input()
Definition: maglev-ir.h:9491
void GenerateCode(MaglevAssembler *, const ProcessingState &)
SetContinuationPreservedEmbedderData(uint64_t bitfield)
Definition: maglev-ir.h:11190
Input & data_input()
Definition: maglev-ir.h:11196
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11200
Definition: maglev-ir.h:9698
Input & key_input()
Definition: maglev-ir.h:9720
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9726
Input & context()
Definition: maglev-ir.h:9718
SetKeyedGeneric(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9702
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:9719
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9712
Input & value_input()
Definition: maglev-ir.h:9721
Definition: maglev-ir.h:9402
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:9423
Input & value_input()
Definition: maglev-ir.h:9424
Input & context()
Definition: maglev-ir.h:9422
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9417
SetNamedGeneric(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9406
compiler::NameRef name() const
Definition: maglev-ir.h:9416
Definition: maglev-ir.h:4885
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4900
void GenerateCode(MaglevAssembler *, const ProcessingState &)
SetPendingMessage(uint64_t bitfield)
Definition: maglev-ir.h:4889
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4891
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4894
Input & value()
Definition: maglev-ir.h:4896
Definition: maglev-ir.h:7849
int MaxCallStackArgs() const
Definition: maglev-ir.h:7866
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & key_input()
Definition: maglev-ir.h:7864
Input & table_input()
Definition: maglev-ir.h:7863
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7873
SetPrototypeHas(uint64_t bitfield)
Definition: maglev-ir.h:7853
Definition: maglev-ir.h:5513
Tagged< Smi > value() const
Definition: maglev-ir.h:5522
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7544
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:5524
void GenerateCode(MaglevAssembler *, const ProcessingState &)
SmiConstant(uint64_t bitfield, Tagged< Smi > value)
Definition: maglev-ir.h:5519
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:888
Definition: maglev-ir.h:4456
SmiCountLeadingZeros(uint64_t bitfield)
Definition: maglev-ir.h:4460
Input & input()
Definition: maglev-ir.h:4467
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4471
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4465
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4462
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int index() const
Definition: maglev-ir.h:9173
StoreContextSlotWithWriteBarrier(uint64_t bitfield, int index)
Definition: maglev-ir.h:9163
Input & new_value_input()
Definition: maglev-ir.h:9178
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & context_input()
Definition: maglev-ir.h:9177
int offset() const
Definition: maglev-ir.h:9172
StoreDoubleDataViewElement(uint64_t bitfield, ExternalArrayType type)
Definition: maglev-ir.h:8907
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8932
Input & object_input()
Definition: maglev-ir.h:8921
Input & value_input()
Definition: maglev-ir.h:8923
void GenerateCode(MaglevAssembler *, const ProcessingState &)
bool is_little_endian_constant()
Definition: maglev-ir.h:8926
Input & is_little_endian_input()
Definition: maglev-ir.h:8924
Input & index_input()
Definition: maglev-ir.h:8922
Definition: maglev-ir.h:8935
StoreDoubleField(uint64_t bitfield, int offset)
Definition: maglev-ir.h:8939
Input & object_input()
Definition: maglev-ir.h:8950
int offset() const
Definition: maglev-ir.h:8946
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value_input()
Definition: maglev-ir.h:8951
Input & elements_input()
Definition: maglev-ir.h:8491
StoreFixedArrayElementNoWriteBarrier(uint64_t bitfield)
Definition: maglev-ir.h:8479
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8501
Input & index_input()
Definition: maglev-ir.h:8492
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value_input()
Definition: maglev-ir.h:8493
int MaxCallStackArgs() const
Definition: maglev-ir.h:8495
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & elements_input()
Definition: maglev-ir.h:8458
Input & value_input()
Definition: maglev-ir.h:8460
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8465
Input & index_input()
Definition: maglev-ir.h:8459
int MaxCallStackArgs() const
Definition: maglev-ir.h:8462
StoreFixedArrayElementWithWriteBarrier(uint64_t bitfield)
Definition: maglev-ir.h:8446
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value_input()
Definition: maglev-ir.h:8592
Input & elements_input()
Definition: maglev-ir.h:8590
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8596
StoreFixedDoubleArrayElement(uint64_t bitfield)
Definition: maglev-ir.h:8580
Input & index_input()
Definition: maglev-ir.h:8591
Definition: maglev-ir.h:8987
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int offset() const
Definition: maglev-ir.h:8998
StoreFloat64(uint64_t bitfield, int offset)
Definition: maglev-ir.h:8991
Input & value_input()
Definition: maglev-ir.h:9003
Input & object_input()
Definition: maglev-ir.h:9002
Definition: maglev-ir.h:9279
StoreGlobal(uint64_t bitfield, compiler::NameRef name, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9283
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9293
Input & context()
Definition: maglev-ir.h:9295
Input & value()
Definition: maglev-ir.h:9296
compiler::NameRef name() const
Definition: maglev-ir.h:9292
Input & name_input()
Definition: maglev-ir.h:9654
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value_input()
Definition: maglev-ir.h:9655
Input & context()
Definition: maglev-ir.h:9652
Input & object_input()
Definition: maglev-ir.h:9653
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9660
StoreInArrayLiteralGeneric(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:9636
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:9646
Definition: maglev-ir.h:8961
Input & object_input()
Definition: maglev-ir.h:8976
Input & value_input()
Definition: maglev-ir.h:8977
StoreInt32(uint64_t bitfield, int offset)
Definition: maglev-ir.h:8965
void GenerateCode(MaglevAssembler *, const ProcessingState &)
int offset() const
Definition: maglev-ir.h:8972
Definition: maglev-ir.h:9078
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:9096
StoreMap(uint64_t bitfield, compiler::MapRef map, Kind kind)
Definition: maglev-ir.h:9087
compiler::MapRef map() const
Definition: maglev-ir.h:9098
Kind
Definition: maglev-ir.h:9082
Kind kind() const
Definition: maglev-ir.h:9099
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:8883
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:8894
ExternalArrayType type() const
Definition: maglev-ir.h:8896
StoreSignedIntDataViewElement(uint64_t bitfield, ExternalArrayType type)
Definition: maglev-ir.h:8866
Input & value_input()
Definition: maglev-ir.h:8885
bool is_little_endian_constant()
Definition: maglev-ir.h:8888
Input & is_little_endian_input()
Definition: maglev-ir.h:8886
Input & index_input()
Definition: maglev-ir.h:8884
bool initializing_or_transitioning() const
Definition: maglev-ir.h:9046
Input & value_input()
Definition: maglev-ir.h:9053
Input & object_input()
Definition: maglev-ir.h:9052
int MaxCallStackArgs() const
Definition: maglev-ir.h:9062
int offset() const
Definition: maglev-ir.h:9045
void GenerateCode(MaglevAssembler *, const ProcessingState &)
StoreTaggedFieldNoWriteBarrier(uint64_t bitfield, int offset, StoreTaggedMode store_mode)
Definition: maglev-ir.h:9028
Input & object_input()
Definition: maglev-ir.h:9137
bool initializing_or_transitioning() const
Definition: maglev-ir.h:9131
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value_input()
Definition: maglev-ir.h:9138
int offset() const
Definition: maglev-ir.h:9130
StoreTaggedFieldWithWriteBarrier(uint64_t bitfield, int offset, StoreTaggedMode store_mode)
Definition: maglev-ir.h:9119
IndirectPointerTag tag() const
Definition: maglev-ir.h:9216
bool initializing_or_transitioning() const
Definition: maglev-ir.h:9217
void GenerateCode(MaglevAssembler *, const ProcessingState &)
StoreTrustedPointerFieldWithWriteBarrier(uint64_t bitfield, int offset, IndirectPointerTag tag, StoreTaggedMode store_mode)
Definition: maglev-ir.h:9201
Definition: maglev-ir.h:9456
StringAt(uint64_t bitfield)
Definition: maglev-ir.h:9460
Input & string_input()
Definition: maglev-ir.h:9470
Input & index_input()
Definition: maglev-ir.h:9471
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9476
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:9519
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9537
StringConcat(uint64_t bitfield)
Definition: maglev-ir.h:9523
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & lhs()
Definition: maglev-ir.h:9531
Input & rhs()
Definition: maglev-ir.h:9532
int MaxCallStackArgs() const
Definition: maglev-ir.h:9534
Definition: maglev-ir.h:4955
int MaxCallStackArgs() const
Definition: maglev-ir.h:4971
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4965
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4961
auto options() const
Definition: maglev-ir.h:4977
StringEqualInputs inputs() const
Definition: maglev-ir.h:4976
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4974
Input & rhs()
Definition: maglev-ir.h:4969
Input & lhs()
Definition: maglev-ir.h:4968
StringEqual(uint64_t bitfield, StringEqualInputs inputs)
Definition: maglev-ir.h:4959
Definition: maglev-ir.h:9499
StringLength(uint64_t bitfield)
Definition: maglev-ir.h:9503
Input & object_input()
Definition: maglev-ir.h:9511
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9516
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:11426
Input & value()
Definition: maglev-ir.h:11464
int value_base() const
Definition: maglev-ir.h:11449
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void set_fallthrough(BasicBlock *fallthrough)
Definition: maglev-ir.h:11459
bool has_fallthrough() const
Definition: maglev-ir.h:11453
Switch(uint64_t bitfield, int value_base, BasicBlockRef *targets, int size, BasicBlockRef *fallthrough)
Definition: maglev-ir.h:11438
Switch(uint64_t bitfield, int value_base, BasicBlockRef *targets, int size)
Definition: maglev-ir.h:11430
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11468
BasicBlock * fallthrough() const
Definition: maglev-ir.h:11454
int size() const
Definition: maglev-ir.h:11451
BasicBlockRef * targets() const
Definition: maglev-ir.h:11450
Definition: maglev-ir.h:4983
Input & rhs()
Definition: maglev-ir.h:4993
TaggedEqual(uint64_t bitfield)
Definition: maglev-ir.h:4987
Input & lhs()
Definition: maglev-ir.h:4992
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5003
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4989
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:5540
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:5551
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:892
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7549
TaggedIndexConstant(uint64_t bitfield, Tagged< TaggedIndex > value)
Definition: maglev-ir.h:5546
Tagged< TaggedIndex > value() const
Definition: maglev-ir.h:5549
Definition: maglev-ir.h:5006
Input & lhs()
Definition: maglev-ir.h:5015
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5026
Input & rhs()
Definition: maglev-ir.h:5016
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5012
void GenerateCode(MaglevAssembler *, const ProcessingState &)
TaggedNotEqual(uint64_t bitfield)
Definition: maglev-ir.h:5010
Definition: maglev-ir.h:11296
TerminalControlNodeT(uint64_t bitfield)
Definition: maglev-ir.h:11300
Definition: maglev-ir.h:11289
TerminalControlNode(uint64_t bitfield)
Definition: maglev-ir.h:11291
Definition: maglev-ir.h:5029
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5051
Input & callable()
Definition: maglev-ir.h:5045
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5038
Input & object()
Definition: maglev-ir.h:5044
Input & context()
Definition: maglev-ir.h:5043
const compiler::FeedbackSource & feedback() const
Definition: maglev-ir.h:5046
TestInstanceOf(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:5033
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5039
Definition: maglev-ir.h:5080
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5089
TestTypeOf(uint64_t bitfield, interpreter::TestTypeOfFlags::LiteralFlag literal)
Definition: maglev-ir.h:5084
interpreter::TestTypeOfFlags::LiteralFlag literal() const
Definition: maglev-ir.h:5099
auto options() const
Definition: maglev-ir.h:5097
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:8088
Input & value()
Definition: maglev-ir.h:5091
Definition: maglev-ir.h:5057
CheckType check_type() const
Definition: maglev-ir.h:5068
void GenerateCode(MaglevAssembler *, const ProcessingState &)
auto options() const
Definition: maglev-ir.h:5074
TestUndetectable(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:5061
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5072
Input & value()
Definition: maglev-ir.h:5067
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5065
Definition: maglev-ir.h:11052
ThrowIfNotCallable(uint64_t bitfield)
Definition: maglev-ir.h:11056
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11068
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value()
Definition: maglev-ir.h:11063
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & constructor()
Definition: maglev-ir.h:11083
ThrowIfNotSuperConstructor(uint64_t bitfield)
Definition: maglev-ir.h:11076
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11089
Input & value()
Definition: maglev-ir.h:10998
compiler::NameRef name() const
Definition: maglev-ir.h:10996
ThrowReferenceErrorIfHole(uint64_t bitfield, const compiler::NameRef name)
Definition: maglev-ir.h:10987
void GenerateCode(MaglevAssembler *, const ProcessingState &)
auto options() const
Definition: maglev-ir.h:11005
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11003
ThrowSuperAlreadyCalledIfNotHole(uint64_t bitfield)
Definition: maglev-ir.h:11036
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11049
Input & value()
Definition: maglev-ir.h:11044
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value()
Definition: maglev-ir.h:11023
ThrowSuperNotCalledIfHole(uint64_t bitfield)
Definition: maglev-ir.h:11016
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11028
Definition: maglev-ir.h:4928
ToBooleanLogicalNot(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:4932
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4943
CheckType check_type() const
Definition: maglev-ir.h:4939
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4936
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value()
Definition: maglev-ir.h:4938
auto options() const
Definition: maglev-ir.h:4945
Definition: maglev-ir.h:4904
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4919
CheckType check_type() const
Definition: maglev-ir.h:4915
ToBoolean(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:4908
auto options() const
Definition: maglev-ir.h:4921
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4912
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value()
Definition: maglev-ir.h:4914
Definition: maglev-ir.h:5105
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ToName(uint64_t bitfield)
Definition: maglev-ir.h:5109
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5112
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5122
Input & value_input()
Definition: maglev-ir.h:5117
Input & context()
Definition: maglev-ir.h:5116
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5113
Definition: maglev-ir.h:5125
Input & value_input()
Definition: maglev-ir.h:5137
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5132
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5143
ToNumberOrNumeric(uint64_t bitfield, Object::Conversion mode)
Definition: maglev-ir.h:5129
Object::Conversion mode() const
Definition: maglev-ir.h:5138
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5135
Definition: maglev-ir.h:5377
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5385
CheckType check_type() const
Definition: maglev-ir.h:5391
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5396
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5386
void GenerateCode(MaglevAssembler *, const ProcessingState &)
ToObject(uint64_t bitfield, CheckType check_type)
Definition: maglev-ir.h:5381
Input & context()
Definition: maglev-ir.h:5389
Input & value_input()
Definition: maglev-ir.h:5390
Definition: maglev-ir.h:5402
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5412
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5424
ConversionMode
Definition: maglev-ir.h:5406
@ kThrowOnSymbol
Definition: maglev-ir.h:5406
@ kConvertSymbol
Definition: maglev-ir.h:5406
ConversionMode mode() const
Definition: maglev-ir.h:5417
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5411
Input & context()
Definition: maglev-ir.h:5415
Input & value_input()
Definition: maglev-ir.h:5416
ToString(uint64_t bitfield, ConversionMode mode)
Definition: maglev-ir.h:5407
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:7933
TransitionAndStoreArrayElement(uint64_t bitfield, const compiler::MapRef &fast_map, const compiler::MapRef &double_map)
Definition: maglev-ir.h:7908
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::MapRef fast_map() const
Definition: maglev-ir.h:7923
int MaxCallStackArgs() const
Definition: maglev-ir.h:7926
Input & index_input()
Definition: maglev-ir.h:7920
Input & array_input()
Definition: maglev-ir.h:7919
compiler::MapRef double_map() const
Definition: maglev-ir.h:7924
Input & value_input()
Definition: maglev-ir.h:7921
const compiler::MapRef transition_target() const
Definition: maglev-ir.h:11160
TransitionElementsKindOrCheckMap(uint64_t bitfield, const ZoneVector< compiler::MapRef > &transition_sources, compiler::MapRef transition_target)
Definition: maglev-ir.h:11135
const ZoneVector< compiler::MapRef > & transition_sources() const
Definition: maglev-ir.h:11157
Input & object_input()
Definition: maglev-ir.h:11149
Input & map_input()
Definition: maglev-ir.h:11150
void GenerateCode(MaglevAssembler *, const ProcessingState &)
const ZoneVector< compiler::MapRef > & transition_sources() const
Definition: maglev-ir.h:11118
const compiler::MapRef transition_target() const
Definition: maglev-ir.h:11121
Input & map_input()
Definition: maglev-ir.h:11111
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:11116
TransitionElementsKind(uint64_t bitfield, const ZoneVector< compiler::MapRef > &transition_sources, compiler::MapRef transition_target)
Definition: maglev-ir.h:11097
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & object_input()
Definition: maglev-ir.h:11110
void GenerateCode(MaglevAssembler *, const ProcessingState &)
TaggedToFloat64ConversionType conversion_type() const
Definition: maglev-ir.h:4826
auto options() const
Definition: maglev-ir.h:4830
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7825
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4816
Input & input()
Definition: maglev-ir.h:4820
TruncateNumberOrOddballToInt32(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition: maglev-ir.h:4811
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4818
Definition: maglev-ir.h:5648
IndirectPointerTag tag() const
Definition: maglev-ir.h:5667
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7592
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:5660
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5658
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
TrustedConstant(uint64_t bitfield, compiler::HeapObjectRef object, IndirectPointerTag tag)
Definition: maglev-ir.h:5654
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:917
void GenerateCode(MaglevAssembler *, const ProcessingState &)
compiler::HeapObjectRef object() const
Definition: maglev-ir.h:5666
TryOnStackReplacement(uint64_t bitfield, int32_t loop_depth, FeedbackSlot feedback_slot, BytecodeOffset osr_offset, MaglevCompilationUnit *unit)
Definition: maglev-ir.h:5237
static constexpr OpProperties kProperties
Definition: maglev-ir.h:5247
const MaglevCompilationUnit * unit() const
Definition: maglev-ir.h:5255
Input & closure()
Definition: maglev-ir.h:5253
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:5251
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:5260
Definition: maglev-ir.h:3892
void DoLoadToRegister(MaglevAssembler *, OutputRegister)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7559
Uint32Constant(uint64_t bitfield, uint32_t value)
Definition: maglev-ir.h:3898
uint32_t value() const
Definition: maglev-ir.h:3903
bool ToBoolean(LocalIsolate *local_isolate) const
Definition: maglev-ir.h:3905
DirectHandle< Object > DoReify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:900
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3901
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:4065
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4075
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4082
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4071
Uint32ToNumber(uint64_t bitfield)
Definition: maglev-ir.h:4069
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & input()
Definition: maglev-ir.h:4077
int MaxCallStackArgs() const
Definition: maglev-ir.h:4079
Definition: maglev-ir.h:3991
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4005
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3999
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3997
Input & input()
Definition: maglev-ir.h:4001
Uint32ToUint8Clamped(uint64_t bitfield)
Definition: maglev-ir.h:3995
UnaryWithFeedbackNode(uint64_t bitfield, const compiler::FeedbackSource &feedback)
Definition: maglev-ir.h:3085
static constexpr int kOperandIndex
Definition: maglev-ir.h:3080
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & operand_input()
Definition: maglev-ir.h:3081
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3091
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3078
compiler::FeedbackSource feedback() const
Definition: maglev-ir.h:3082
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3076
const compiler::FeedbackSource feedback_
Definition: maglev-ir.h:3093
UncheckedNumberOrOddballToFloat64(uint64_t bitfield, TaggedToFloat64ConversionType conversion_type)
Definition: maglev-ir.h:4683
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4688
auto options() const
Definition: maglev-ir.h:4703
Input & input()
Definition: maglev-ir.h:4693
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7815
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4691
void GenerateCode(MaglevAssembler *, const ProcessingState &)
TaggedToFloat64ConversionType conversion_type() const
Definition: maglev-ir.h:4699
UnconditionalControlNodeT(uint64_t bitfield, BasicBlockRef *target_refs)
Definition: maglev-ir.h:11256
UnconditionalControlNodeT(uint64_t bitfield, BasicBlock *target)
Definition: maglev-ir.h:11260
void set_predecessor_id(int id)
Definition: maglev-ir.h:11234
int predecessor_id() const
Definition: maglev-ir.h:11233
UnconditionalControlNode(uint64_t bitfield, BasicBlock *target)
Definition: maglev-ir.h:11242
UnconditionalControlNode(uint64_t bitfield, BasicBlockRef *target_refs)
Definition: maglev-ir.h:11239
void set_target(BasicBlock *block)
Definition: maglev-ir.h:11236
BasicBlock * target() const
Definition: maglev-ir.h:11232
Definition: maglev-ir.h:4265
Input & input()
Definition: maglev-ir.h:4276
static constexpr OpProperties kProperties
Definition: maglev-ir.h:4271
UnsafeInt32ToUint32(uint64_t bitfield)
Definition: maglev-ir.h:4269
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:4280
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:4274
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:3746
UnsafeSmiTagInt32(uint64_t bitfield)
Definition: maglev-ir.h:3750
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3752
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3766
Input & input()
Definition: maglev-ir.h:3756
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3754
Definition: maglev-ir.h:3794
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & input()
Definition: maglev-ir.h:3804
UnsafeSmiTagIntPtr(uint64_t bitfield)
Definition: maglev-ir.h:3798
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3802
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3814
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3800
Definition: maglev-ir.h:3770
UnsafeSmiTagUint32(uint64_t bitfield)
Definition: maglev-ir.h:3774
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3778
Input & input()
Definition: maglev-ir.h:3780
void GenerateCode(MaglevAssembler *, const ProcessingState &)
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3776
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3790
Definition: maglev-ir.h:3842
static constexpr OpProperties kProperties
Definition: maglev-ir.h:3848
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:3863
Input & input()
Definition: maglev-ir.h:3853
void GenerateCode(MaglevAssembler *, const ProcessingState &)
UnsafeSmiUntag(uint64_t bitfield)
Definition: maglev-ir.h:3846
static constexpr Base::InputTypes kInputTypes
Definition: maglev-ir.h:3851
Definition: maglev-ir.h:9577
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Input & value_input()
Definition: maglev-ir.h:9588
int MaxCallStackArgs() const
Definition: maglev-ir.h:9590
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9593
UnwrapStringWrapper(uint64_t bitfield)
Definition: maglev-ir.h:9581
Definition: maglev-ir.h:9309
UpdateJSArrayLength(uint64_t bitfield)
Definition: maglev-ir.h:9313
void GenerateCode(MaglevAssembler *, const ProcessingState &)
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.h:9333
Input & length_input()
Definition: maglev-ir.h:9327
Input & index_input()
Definition: maglev-ir.h:9329
Input & object_input()
Definition: maglev-ir.h:9328
Definition: maglev-ir.h:1431
Register AssignedGeneralRegister() const
Definition: maglev-ir.h:1464
bool IsDoubleRegister() const
Definition: maglev-ir.h:1476
bool IsGeneralRegister() const
Definition: maglev-ir.h:1475
const compiler::InstructionOperand & operand() const
Definition: maglev-ir.h:1478
bool IsAnyRegister() const
Definition: maglev-ir.h:1474
bool Cloberred()
Definition: maglev-ir.h:1453
void SetUnallocated(Args &&... args)
Definition: maglev-ir.h:1436
void InjectLocation(compiler::InstructionOperand location)
Definition: maglev-ir.h:1448
void SetConstant(Args &&... args)
Definition: maglev-ir.h:1459
const compiler::InstructionOperand & operand()
Definition: maglev-ir.h:1479
void SetAllocated(Args &&... args)
Definition: maglev-ir.h:1442
DoubleRegister AssignedDoubleRegister() const
Definition: maglev-ir.h:1469
Definition: maglev-ir.h:2608
ValueLocation result_
Definition: maglev-ir.h:2880
ValueLocation & result()
Definition: maglev-ir.h:2616
int use_count() const
Definition: maglev-ir.h:2619
compiler::InstructionOperand hint_
Definition: maglev-ir.h:2892
const ValueLocation & result() const
Definition: maglev-ir.h:2617
NodeIdT start_id() const
Definition: maglev-ir.h:2876
bool unused_inputs_were_visited() const
Definition: maglev-ir.h:2625
void record_next_use(NodeIdT id, InputLocation *input_location)
Definition: maglev-ir.h:2702
compiler::InstructionOperand loadable_slot() const
Definition: maglev-ir.h:2696
constexpr ValueRepresentation value_representation() const
Definition: maglev-ir.h:2763
bool is_loadable() const
Definition: maglev-ir.h:2657
bool has_register() const
Definition: maglev-ir.h:2818
LiveRange live_range() const
Definition: maglev-ir.h:2719
void AddRegister(DoubleRegister reg)
Definition: maglev-ir.h:2795
int FirstRegisterCode() const
Definition: maglev-ir.h:2868
NodeIdT current_next_use() const
Definition: maglev-ir.h:2720
compiler::AllocatedOperand spill_slot() const
Definition: maglev-ir.h:2691
void LoadToRegister(MaglevAssembler *, DoubleRegister)
void SetNoSpill()
Definition: maglev-ir.cc:485
RegList registers_with_result_
Definition: maglev-ir.h:2882
constexpr bool is_tagged() const
Definition: maglev-ir.h:2732
ValueNode(uint64_t bitfield)
Definition: maglev-ir.h:2855
bool has_valid_live_range() const
Definition: maglev-ir.h:2718
void advance_next_use(NodeIdT use)
Definition: maglev-ir.h:2724
bool is_spilled() const
Definition: maglev-ir.h:2662
void AddRegister(Register reg)
Definition: maglev-ir.h:2791
void Spill(compiler::AllocatedOperand operand)
Definition: maglev-ir.h:2677
DirectHandle< Object > Reify(LocalIsolate *isolate) const
Definition: maglev-ir.cc:872
bool has_no_more_uses() const
Definition: maglev-ir.h:2726
void LoadToRegister(MaglevAssembler *, Register)
bool has_hint()
Definition: maglev-ir.h:2643
int use_count_
Definition: maglev-ir.h:2894
NodeIdT end_id_
Definition: maglev-ir.h:2878
bool is_used() const
Definition: maglev-ir.h:2624
void InitializeRegisterData()
Definition: maglev-ir.h:2783
RegListBase< T > result_registers()
Definition: maglev-ir.h:2834
int num_registers() const
Definition: maglev-ir.h:2812
compiler::InstructionOperand spill_
Definition: maglev-ir.h:2890
void ClearHint()
Definition: maglev-ir.h:2641
RegListBase< T > ClearRegisters()
constexpr bool decompresses_tagged_result() const
Definition: maglev-ir.h:2760
NodeIdT * last_uses_next_use_id_
Definition: maglev-ir.h:2889
void RemoveRegister(Register reg)
Definition: maglev-ir.h:2800
void DoLoadToRegister(MaglevAssembler *, Register)
compiler::InstructionOperand allocation() const
Definition: maglev-ir.h:2844
void mark_unused_inputs_visited()
Definition: maglev-ir.h:2634
void remove_use()
Definition: maglev-ir-inl.h:128
RegisterT GetRegisterHint()
Definition: maglev-ir.h:2646
void SetConstantLocation()
Definition: maglev-ir.cc:493
void SetHint(compiler::InstructionOperand hint)
Definition: maglev-ir.cc:467
constexpr bool use_double_register() const
Definition: maglev-ir.h:2728
constexpr MachineRepresentation GetMachineRepresentation() const
Definition: maglev-ir.h:2767
bool is_in_register(DoubleRegister reg) const
Definition: maglev-ir.h:2828
void DoLoadToRegister(MaglevAssembler *, DoubleRegister)
void add_use()
Definition: maglev-ir.h:2626
const compiler::InstructionOperand & hint() const
Definition: maglev-ir.h:2652
NodeIdT next_use_
Definition: maglev-ir.h:2879
DoubleRegList double_registers_with_result_
Definition: maglev-ir.h:2883
bool is_in_register(Register reg) const
Definition: maglev-ir.h:2824
void RemoveRegister(DoubleRegister reg)
Definition: maglev-ir.h:2804
bool operator==(const Iterator &other) const
Definition: maglev-ir.h:6183
VirtualObject *& operator*()
Definition: maglev-ir.h:6189
VirtualObject * operator->()
Definition: maglev-ir.h:6190
Iterator(VirtualObject *entry)
Definition: maglev-ir.h:6177
Iterator & operator++()
Definition: maglev-ir.h:6179
bool operator!=(const Iterator &other) const
Definition: maglev-ir.h:6186
Definition: maglev-ir.h:6171
Iterator end() const
Definition: maglev-ir.h:6264
VirtualObjectList()
Definition: maglev-ir.h:6173
void Add(VirtualObject *object)
Definition: maglev-ir.h:6200
void Print(std::ostream &os, const char *prefix, MaglevGraphLabeller *labeller) const
Definition: maglev-ir.cc:330
VirtualObject * FindAllocatedWith(const InlinedAllocation *allocation) const
Definition: maglev-ir.h:6209
bool IsSnapshot() const
Definition: maglev-ir.h:6256
Iterator begin() const
Definition: maglev-ir.h:6263
static VirtualObject * WalkUntilCommon(const VirtualObjectList &list1, const VirtualObjectList &list2, Function &&f)
Definition: maglev-ir.h:6225
bool operator==(const VirtualObjectList &other) const
Definition: maglev-ir.h:6196
void Snapshot() const
Definition: maglev-ir.h:6244
bool is_empty() const
Definition: maglev-ir.h:6207
Definition: maglev-ir.h:5820
void ForEachNestedRuntimeInput(VirtualObjectList virtual_objects, Function &&f)
Definition: maglev-ir.h:6383
constexpr bool has_static_map() const
Definition: maglev-ir.h:5902
void set(uint32_t offset, ValueNode *value)
Definition: maglev-ir.h:5956
ValueNode * string_length() const
Definition: maglev-ir.h:5968
void ForEachInput(Function &&callback)
Definition: maglev-ir.h:6016
void Snapshot()
Definition: maglev-ir.h:6013
compiler::FixedDoubleArrayRef double_elements() const
Definition: maglev-ir.h:5943
size_t size() const
Definition: maglev-ir.h:5920
VirtualObject(uint64_t bitfield, compiler::MapRef map, int id, uint32_t length, compiler::FixedDoubleArrayRef elements)
Definition: maglev-ir.h:5887
void GenerateCode(MaglevAssembler *, const ProcessingState &)
Definition: maglev-ir.h:5899
void ClearSlots(int last_init_slot, ValueNode *clear_value)
Definition: maglev-ir.h:5978
ObjectFields slots_
Definition: maglev-ir.h:6162
void SetValueLocationConstraints()
Definition: maglev-ir.h:5898
VirtualObject(uint64_t bitfield, compiler::MapRef map, int id, Float64 number)
Definition: maglev-ir.h:5877
bool IsSnapshot() const
Definition: maglev-ir.h:6012
void set_allocation(InlinedAllocation *allocation)
Definition: maglev-ir.h:5987
Type
Definition: maglev-ir.h:5824
@ kHeapNumber
Definition: maglev-ir.h:5826
@ kDefault
Definition: maglev-ir.h:5825
@ kLast
Definition: maglev-ir.h:5830
@ kConsString
Definition: maglev-ir.h:5828
@ kFixedDoubleArray
Definition: maglev-ir.h:5827
void ForEachInput(Function &&callback) const
Definition: maglev-ir.h:6036
ValueNode * get(uint32_t offset) const
Definition: maglev-ir.h:5948
Type type() const
Definition: maglev-ir.h:5917
std::optional< VirtualObject * > Merge(const VirtualObject *other, uint32_t new_object_id, Zone *zone, Function MergeValue) const
Definition: maglev-ir.h:6065
uint32_t double_elements_length() const
Definition: maglev-ir.h:5938
const VirtualConsString & cons_string() const
Definition: maglev-ir.h:5973
VirtualObject(uint64_t bitfield, compiler::MapRef map, int id, uint32_t slot_count, ValueNode **slots)
Definition: maglev-ir.h:5867
uint32_t slot_count() const
Definition: maglev-ir.h:6125
uint32_t id() const
Definition: maglev-ir.h:5918
InlinedAllocation * allocation() const
Definition: maglev-ir.h:5986
DoubleArray double_array_
Definition: maglev-ir.h:6161
Float64 number_
Definition: maglev-ir.h:6160
compiler::MapRef map() const
Definition: maglev-ir.h:5913
void PrintParams(std::ostream &, MaglevGraphLabeller *) const
Definition: maglev-ir.cc:7662
VirtualConsString cons_string_
Definition: maglev-ir.h:6163
VirtualObject(uint64_t bitfield, int id, const VirtualConsString &cons_string)
Definition: maglev-ir.h:5861
bool compatible_for_merge(const VirtualObject *other) const
Definition: maglev-ir.h:5991
friend std::ostream & operator<<(std::ostream &out, Type type)
Definition: maglev-ir.h:5833
Float64 number() const
Definition: maglev-ir.h:5933
VirtualObject * Clone(uint32_t new_object_id, Zone *zone, bool empty_clone=false) const
Definition: maglev-ir.h:6091
Definition: maglev-ir.h:2964
constexpr ArrayWrapper(Args &&... args)
Definition: maglev-ir.h:2967
Handle< SharedFunctionInfo > key_
Definition: compilation-cache-table.cc:185
JSRegExp::Flags flags_
Definition: compilation-cache-table.cc:173
uint32_t count
Definition: debug-coverage.cc:600
int end
Definition: debug-coverage.cc:602
base::Vector< const DirectHandle< Object > > args
Definition: execution.cc:74
DirectHandle< Object > new_target
Definition: execution.cc:75
int pc
Definition: experimental-interpreter.cc:554
other heap size generate builtins concurrently on separate threads in mksnapshot track concurrent recompilation artificial compilation delay in ms max number of threads that concurrent Turbofan can use(0 for unbounded)") DEFINE_BOOL( stress_concurrent_inlining
refactor address components for immediate indexing make OptimizeMaglevOnNextCall optimize to turbofan instead of maglev filter for tracing turbofan compilation nullptr
Definition: flag-definitions.h:1280
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enables Turboshaft s StaticAssert and CheckTurboshaftTypeOf operations Wasm code into JS functions via the JS to Wasm wrappers are still inlined in TurboFan For controlling whether to at see turbo inline js wasm calls enable Turboshaft s loop unrolling enable an additional Turboshaft phase that performs optimizations based on type information enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps trace Turboshaft s if else to switch reducer invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the preconfigured old space Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often Release pooled large pages after X seconds prints number of allocations and enables analysis mode for gc fuzz e g stress stress scavenge force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible discard the memory pool before invoking the GC on memory pressure or last resort GCs Delay before memory reducer start virtual randomize memory reservations by ignoring any hints passed when allocating pages use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of SAHF instruction if enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long mode(MIPS/PPC only)") DEFINE_BOOL(partial_constant_pool
other heap size flags(e.g. initial_heap_size) take precedence") DEFINE_SIZE_T( max_shared_heap_size
Isolate * isolate
Definition: graph-builder.cc:67
JSHeapBroker * broker
Definition: graph-builder.cc:68
const ClassType * type_
Definition: implementation-visitor.cc:3838
OptionalOpIndex index
Definition: instruction-selector-ia32.cc:65
int32_t offset
Definition: instruction-selector-ia32.cc:66
TNode< Context > context
Definition: js-call-reducer.cc:1589
TNode< Object > target
Definition: js-call-reducer.cc:1590
TNode< Object > receiver
Definition: js-call-reducer.cc:1592
TNode< Object > callback
Definition: js-call-reducer.cc:1593
std::map< const std::string, const std::string, std::less<> > map
Definition: js-date-time-format.cc:277
std::string pattern
Definition: js-date-time-format.cc:128
Node * node
Definition: js-inlining-heuristic.cc:381
RpoNumber block
Definition: jump-threading.cc:62
ZoneVector< RpoNumber > & result
Definition: jump-threading.cc:21
Builtin builtin
Definition: liftoff-compiler.cc:539
LiftoffRegister reg
Definition: liftoff-compiler.cc:521
LiftoffAssembler::CacheState state
Definition: liftoff-compiler.cc:462
ZoneVector< int > slots
Definition: liftoff-compiler.cc:530
FunctionLiteral * literal
Definition: liveedit.cc:294
Node * condition
Definition: machine-operator-reducer.cc:2792
#define DEF_OPCODE_OF(Name)
Definition: maglev-ir.h:2046
#define DEF_FORWARD_DECLARATION(type,...)
Definition: maglev-ir.h:1091
#define CONDITIONAL_CONTROL_NODE_LIST(V)
Definition: maglev-ir.h:426
#define DEOPTIMIZE_REASON_FIELD
Definition: maglev-ir.h:2070
#define DEF_INT32_UNARY_WITH_OVERFLOW_NODE(Name)
Definition: maglev-ir.h:3252
#define NODE_BASE_LIST(V)
Definition: maglev-ir.h:445
#define NODE_TYPE_LIST(V)
Definition: maglev-ir.h:701
#define STORE_TYPED_ARRAY(name, properties, type,...)
Definition: maglev-ir.h:8773
#define DEF_BINARY_WITH_FEEDBACK_NODE(Name)
Definition: maglev-ir.h:3139
#define LEAF_NODE_TYPE_LIST(V)
Definition: maglev-ir.h:637
#define LOAD_TYPED_ARRAY(name, properties,...)
Definition: maglev-ir.h:8677
#define ADD_STATIC_ASSERT(Name, Value)
Definition: maglev-ir.h:836
#define GAP_MOVE_NODE_LIST(V)
Definition: maglev-ir.h:333
#define NODE_LIST(V)
Definition: maglev-ir.h:405
#define DEF_UNARY_WITH_FEEDBACK_NODE(Name)
Definition: maglev-ir.h:3137
#define STORE_CONSTANT_TYPED_ARRAY(name, properties, type,...)
Definition: maglev-ir.h:8814
#define BRANCH_CONTROL_NODE_LIST(V)
Definition: maglev-ir.h:409
#define PLUS_ONE(type)
Definition: maglev-ir.h:453
#define VALUE_NODE_LIST(V)
Definition: maglev-ir.h:170
#define CONTROL_NODE_LIST(V)
Definition: maglev-ir.h:440
#define UNCONDITIONAL_CONTROL_NODE_LIST(V)
Definition: maglev-ir.h:430
#define DEF_FLOAT64_BINARY_NODE_WITH_CALL(Name)
Definition: maglev-ir.h:3451
#define IEEE_754_UNARY_LIST(V)
Definition: maglev-ir.h:3542
#define DEF_OPCODES(type)
Definition: maglev-ir.h:450
#define DEFINE_NODE_TYPE_CHECK(Type, _)
Definition: maglev-ir.h:995
#define DEF_FLOAT64_BINARY_NODE(Name)
Definition: maglev-ir.h:3449
#define DEF_INT32_BINARY_WITH_OVERFLOW_NODE(Name)
Definition: maglev-ir.h:3180
#define COUNT(...)
Definition: maglev-ir.h:674
#define TERMINAL_CONTROL_NODE_LIST(V)
Definition: maglev-ir.h:435
#define LOAD_CONSTANT_TYPED_ARRAY(name, properties,...)
#define ASSERT_CONDITION(V)
Definition: maglev-ir.h:6740
#define DEF_INT32_BINARY_NODE(Name)
Definition: maglev-ir.h:3208
#define CONSTANT_VALUE_NODE_LIST(V)
Definition: maglev-ir.h:145
InstructionOperand source
Definition: move-optimizer.cc:16
int n
Definition: mul-fft.cc:296
Definition: hashing.h:364
unsigned short uint16_t
Definition: unicode.cc:41
int int32_t
Definition: unicode.cc:42
constexpr unsigned CountTrailingZerosNonZero(T value) requires(std
Definition: bits.h:173
constexpr int ClearLsb(T value) requires std
Definition: bits.h:295
V8_INLINE size_t hash_combine(size_t seed, size_t hash)
Definition: hashing.h:77
auto make_iterator_range(ForwardIterator begin, ForwardIterator end)
Definition: iterator.h:65
V8_INLINE size_t hash_value(unsigned long v)
Definition: hashing.h:209
T Divide(T x, T y)
Definition: overflowing-math.h:69
void Add(RWDigits Z, Digits X, Digits Y)
Definition: vector-arithmetic.cc:41
void Subtract(RWDigits Z, Digits X, Digits Y)
Definition: vector-arithmetic.cc:59
void Register()
Definition: etw-jit-win.cc:187
constexpr size_t input_count()
Definition: operations.h:9503
FloatWithBits< 64 > Float64
Definition: index.h:240
CanThrow
Definition: compiler/globals.h:26
@ kSmi
Definition: heap-refs.cc:63
Node::Uses::const_iterator begin(const Node::Uses &uses)
Definition: node.h:708
constexpr T * ObjectPtrBeforeAddress(void *address)
Definition: maglev-ir.h:2055
UINT32_ELEMENTS INT32_ELEMENTS FLOAT32_ELEMENTS
Definition: maglev-ir.h:8768
UseRepresentation
Definition: maglev-ir.h:9819
constexpr bool IsControlNode(Opcode opcode)
Definition: maglev-ir.h:545
std::underlying_type_t< NodeType > NodeTypeInt
Definition: maglev-ir.h:710
UINT8_CLAMPED_ELEMENTS
Definition: maglev-ir.h:8714
constexpr Condition ConditionForNaN()
Definition: maglev-assembler-arm-inl.h:25
NodeType StaticTypeForConstant(compiler::JSHeapBroker *broker, compiler::ObjectRef ref)
Definition: maglev-ir.h:879
requires(FloatType==ValueRepresentation::kFloat64||FloatType==ValueRepresentation::kHoleyFloat64) void CheckedNumberOrOddballToFloat64OrHoleyFloat64< Derived
HoleyFloat64
Definition: maglev-ir.h:4572
StringEqualInputs
Definition: maglev-ir.h:4954
AssertCondition
Definition: maglev-ir.h:6752
bool HasOnlyStringMaps(base::Vector< const compiler::MapRef > maps)
Definition: maglev-ir.h:1070
base::EnumSet< UseRepresentation, int8_t > UseRepresentationSet
Definition: maglev-ir.h:9847
Opcode
Definition: maglev-ir.h:451
base::EnumSet< ValueRepresentation, int8_t > ValueRepresentationSet
Definition: maglev-ir.h:9846
bool IsInstanceOfLeafNodeType(compiler::MapRef map, NodeType type, compiler::JSHeapBroker *broker)
Definition: maglev-ir.h:893
constexpr Condition ConditionFor(Operation operation)
Definition: maglev-assembler.h:1114
constexpr NodeType EmptyNodeType()
Definition: maglev-ir.h:729
ValueRepresentation
Definition: maglev-ir.h:610
constexpr bool IsTerminalControlNode(Opcode opcode)
Definition: maglev-ir.h:560
constexpr NodeType UnionType(NodeType left, NodeType right)
Definition: maglev-ir.h:737
FixedInputNodeTMixin< InputCount, ValueNodeT< Derived >, Derived > FixedInputValueNodeT
Definition: maglev-ir.h:3045
UINT32_ELEMENTS INT8_ELEMENTS
Definition: maglev-ir.h:8759
bool HasOnlyNumberMaps(base::Vector< const compiler::MapRef > maps)
Definition: maglev-ir.h:1077
constexpr bool NodeTypeIs(NodeType type, NodeType to_check)
Definition: maglev-ir.h:743
constexpr bool IsZeroCostNode(Opcode opcode)
Definition: maglev-ir.h:532
constexpr bool IsEmptyNodeType(NodeType type)
Definition: maglev-ir.h:874
bool HasOnlyJSTypedArrayMaps(base::Vector< const compiler::MapRef > maps)
Definition: maglev-ir.h:1049
constexpr OpProperties StaticPropertiesForOpcode(Opcode opcode)
Definition: maglev-ir.h:11841
constexpr NodeType IntersectType(NodeType left, NodeType right)
Definition: maglev-ir.h:731
constexpr bool NodeTypeIsUnstable(NodeType type)
Definition: maglev-ir.h:756
const char * OpcodeToString(Opcode opcode)
Definition: maglev-ir.cc:52
bool IsInitializingOrTransitioning(StoreTaggedMode mode)
Definition: maglev-ir.h:9018
constexpr NodeType MakeTypeStable(NodeType type)
Definition: maglev-ir.h:797
constexpr bool IsConstantNode(Opcode opcode)
Definition: maglev-ir.h:510
UINT8_ELEMENTS
Definition: maglev-ir.h:8714
UINT32_ELEMENTS INT16_ELEMENTS
Definition: maglev-ir.h:8759
void CheckValueInputIs(const NodeBase *node, int i, ValueRepresentation expected, MaglevGraphLabeller *graph_labeller)
Definition: maglev-ir.cc:533
constexpr bool IsZeroExtendedRepresentation(ValueRepresentation repr)
Definition: maglev-ir.h:624
uint32_t NodeIdT
Definition: maglev-ir.h:1095
EscapeAnalysisResult
Definition: maglev-ir.h:6270
constexpr bool IsValueNode(Opcode opcode)
Definition: maglev-ir.h:507
DEFINE_TRUNCATE_NODE(TruncateFloat64ToInt32, HoleyFloat64, OpProperties::Int32()) DEFINE_TRUNCATE_NODE(UnsafeTruncateFloat64ToInt32
NodeType StaticTypeForNode(compiler::JSHeapBroker *broker, LocalIsolate *isolate, ValueNode *node)
Definition: maglev-graph-builder.cc:4521
StoreTaggedMode
Definition: maglev-ir.h:9013
constexpr bool IsCommutativeNode(Opcode opcode)
Definition: maglev-ir.h:514
bool IsInstanceOfNodeType(compiler::MapRef map, NodeType type, compiler::JSHeapBroker *broker)
Definition: maglev-ir.h:946
bool FromConstantToBool(LocalIsolate *local_isolate, ValueNode *node)
Definition: maglev-ir.cc:365
constexpr bool IsConditionalControlNode(Opcode opcode)
Definition: maglev-ir.h:552
std::ostream & operator<<(std::ostream &os, const PrintNode &printer)
Definition: maglev-graph-printer.h:144
NodeType
Definition: maglev-ir.h:705
constexpr bool IsDoubleRepresentation(ValueRepresentation repr)
Definition: maglev-ir.h:619
constexpr bool IsSimpleFieldStore(Opcode opcode)
Definition: maglev-ir.h:566
NodeType StaticTypeForMap(compiler::MapRef map, compiler::JSHeapBroker *broker)
Definition: maglev-ir.h:842
constexpr bool CanBeStoreToNonEscapedObject(Opcode opcode)
Definition: maglev-ir.h:586
constexpr bool IsTypedArrayStore(Opcode opcode)
Definition: maglev-ir.h:581
TaggedToFloat64ConversionType
Definition: maglev-ir.h:1007
constexpr bool NodeTypeIsNeverStandalone(NodeType type)
Definition: maglev-ir.h:714
bool HasNumberMap(base::Vector< const compiler::MapRef > maps)
Definition: maglev-ir.h:1084
bool NodeTypeMayBeNullOrUndefined(NodeType type)
Definition: maglev-ir.h:1002
UINT16_ELEMENTS
Definition: maglev-ir.h:8714
CheckType
Definition: maglev-ir.h:4903
constexpr bool IsBranchControlNode(Opcode opcode)
Definition: maglev-ir.h:548
bool HasOnlyJSArrayMaps(base::Vector< const compiler::MapRef > maps)
Definition: maglev-ir.h:1056
constexpr bool NodeTypeCanBe(NodeType type, NodeType to_check)
Definition: maglev-ir.h:749
constexpr bool IsUnconditionalControlNode(Opcode opcode)
Definition: maglev-ir.h:556
constexpr bool IsGapMoveNode(Opcode opcode)
Definition: maglev-ir.h:542
bool HasOnlyJSObjectMaps(base::Vector< const compiler::MapRef > maps)
Definition: maglev-ir.h:1063
constexpr bool IsElementsArrayWrite(Opcode opcode)
Definition: maglev-ir.h:577
void Store(LiftoffAssembler *assm, LiftoffRegister src, MemOperand dst, ValueKind kind)
Definition: liftoff-assembler-arm-inl.h:279
constexpr Condition Negate(Condition cond)
Definition: liftoff-assembler.h:30
typedef void(VECTORCALL PWasmOp)(const uint8_t *code
Definition: api-arguments-inl.h:20
constexpr Register no_reg
Definition: register-arm.h:92
int index
Definition: heap-snapshot-generator.cc:1698
constexpr int kTaggedSize
Definition: common/globals.h:533
@ kNotFound
Definition: common/globals.h:1731
DwVfpRegister DoubleRegister
Definition: register-arm.h:192
CreateArgumentsType
Definition: common/globals.h:1882
Condition
Definition: constants-arm.h:82
@ NONE
Definition: property-details.h:19
IndirectPointerTag
Definition: indirect-pointer-tag.h:110
DeoptimizeReason
Definition: deoptimize-reason.h:109
ScopeType
Definition: common/globals.h:1908
Tagged(T object) -> Tagged< T >
internal
Definition: wasm-objects-inl.h:453
RegListBase< Register > RegList
Definition: reglist-arm.h:14
Opcode
Definition: constants-loong64.h:234
ElementsKind
Definition: elements-kind.h:105
AllocationType
Definition: common/globals.h:1378
int32_t key
Definition: external-reference.cc:1399
AbortReason
Definition: bailout-reason.h:157
RegListBase< DoubleRegister > DoubleRegList
Definition: reglist-arm.h:15
InstanceType
Definition: instance-type.h:116
else if(instr->arch_opcode()==kRiscvCmpZero)
Definition: code-generator-riscv.cc:4230
DCHECK(IsNull(value)||IsNativeContext(value)||value==Smi::uninitialized_deserialization_value())
TypeofMode
Definition: common/globals.h:794
uintptr_t Address
Definition: memcopy.h:22
ConvertReceiverMode
Definition: common/globals.h:1849
ExternalArrayType
Definition: common/globals.h:2464
@ kExternalFloat64Array
Definition: common/globals.h:2473
@ kExternalInt32Array
Definition: common/globals.h:2469
@ kExternalInt8Array
Definition: common/globals.h:2465
@ kExternalInt16Array
Definition: common/globals.h:2467
MachineRepresentation
Definition: machine-type.h:19
return value
Definition: map-inl.h:912
ObjectFields
Definition: map.h:145
Builtin
Definition: builtins.h:49
constexpr int kMaxInt
Definition: common/globals.h:375
RootIndex
Definition: roots.h:498
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset prototype
Definition: map-inl.h:69
constexpr int MB
Definition: v8-internal.h:56
size_t length
Definition: external-reference.cc:1499
constexpr bool PointerCompressionIsEnabled()
Definition: v8-internal.h:192
!IsContextMap !IsContextMap native_context
Definition: map-inl.h:896
LanguageMode
Definition: common/globals.h:743
Definition: api-arguments-inl.h:19
#define UNARY_OPERATION_LIST(V)
Definition: operation.h:24
std::ostream & operator<<(std::ostream &os, const Operation &operation)
Definition: operation.h:49
#define ARITHMETIC_OPERATION_LIST(V)
Definition: operation.h:10
#define COMPARISON_OPERATION_LIST(V)
Definition: operation.h:30
uint32_t cast
Definition: random-module-generation.cc:55
int size
Definition: setup-heap-internal.cc:131
#define UNREACHABLE()
Definition: src/base/logging.h:67
#define DCHECK_LE(v1, v2)
Definition: src/base/logging.h:489
#define DCHECK_NULL(val)
Definition: src/base/logging.h:490
#define CHECK(condition)
Definition: src/base/logging.h:124
#define DCHECK_NOT_NULL(val)
Definition: src/base/logging.h:491
#define DCHECK_IMPLIES(v1, v2)
Definition: src/base/logging.h:492
#define DCHECK_NE(v1, v2)
Definition: src/base/logging.h:485
#define DCHECK_GE(v1, v2)
Definition: src/base/logging.h:487
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
Definition: src/base/logging.h:481
#define DCHECK_LT(v1, v2)
Definition: src/base/logging.h:488
#define DCHECK_EQ(v1, v2)
Definition: src/base/logging.h:484
#define DCHECK_GT(v1, v2)
Definition: src/base/logging.h:486
#define USE(...)
Definition: src/base/macros.h:293
constexpr bool IsAligned(T value, U alignment)
Definition: src/base/macros.h:403
Definition: threaded-list.h:17
Definition: feedback-source.h:15
Definition: v8-fast-api-calls.h:511
const base::Vector< ValueNode * > parameters
Definition: maglev-ir.h:1544
const Builtin builtin_id
Definition: maglev-ir.h:1543
compiler::OptionalJSFunctionRef maybe_js_target
Definition: maglev-ir.h:1546
const MaglevCompilationUnit & unit
Definition: maglev-ir.h:1536
ValueNode * receiver
Definition: maglev-ir.h:1538
const SourcePosition source_position
Definition: maglev-ir.h:1537
const base::Vector< ValueNode * > arguments
Definition: maglev-ir.h:1532
ValueNode * closure
Definition: maglev-ir.h:1531
const BytecodeOffset bytecode_position
Definition: maglev-ir.h:1530
const MaglevCompilationUnit & unit
Definition: maglev-ir.h:1529
const BytecodeOffset bytecode_position
Definition: maglev-ir.h:1524
const MaglevCompilationUnit & unit
Definition: maglev-ir.h:1521
const CompactInterpreterFrameState * frame_state
Definition: maglev-ir.h:1522
ValueNode * closure
Definition: maglev-ir.h:1523
const SourcePosition source_position
Definition: maglev-ir.h:1525
Definition: maglev-ir.h:3028
Definition: maglev-interpreter-frame-state.h:268
Definition: maglev-ir.h:2037
Definition: maglev-ir.h:1861
RegList live_registers
Definition: maglev-ir.h:1862
RegList live_tagged_registers
Definition: maglev-ir.h:1863
DoubleRegList live_double_registers
Definition: maglev-ir.h:1864
Definition: maglev-ir.h:2713
NodeIdT end
Definition: maglev-ir.h:2715
NodeIdT start
Definition: maglev-ir.h:2714
ValueNode * length
Definition: maglev-ir.h:5857
ValueNode * second() const
Definition: maglev-ir.h:5853
std::array< ValueNode *, 2 > data
Definition: maglev-ir.h:5858
ValueNode * map
Definition: maglev-ir.h:5856
ValueNode * first() const
Definition: maglev-ir.h:5852
std::unique_ptr< ValueMirror > value
Definition: value-mirror.cc:996
wasm::ValueType type
Definition: wasm-inlining-into-js.cc:31